怎么做跳转网站首页,百度站长工具网站,河南洛阳霞光网络,做啥网站能挣钱文章目录 篇头错误提示错误原因解决方法 篇头
最近使用ubuntu14.04#xff0c;搭配gitlab出现此gnutls_handshake() failed: Handshake failed问题#xff0c;一直未能解决#xff0c;直到找到本文的脚本#xff0c;修正编译错误后#xff0c;终于得以解决。记录一下搭配gitlab出现此gnutls_handshake() failed: Handshake failed问题一直未能解决直到找到本文的脚本修正编译错误后终于得以解决。记录一下分享给大家。
错误提示
fatal: unable to access https://192.168.31.187/aw/android.git/: gnutls_handshake() failed: Handshake failed错误原因
git工具默认使用gnutls包进行网络加密传输但在特殊情况下如使用了代理服务器gnutls会出现奇怪的问题我们可以使用更稳定的openssl包来代替gnutils的功能。只有在低版本Ubuntu 14.04上遇到此问题其余版本20.04及以上未有遇到
解决方法
如下直接使用此脚本已在原版上增加CFLAGS-stdgnu99亲测OK
#!/usr/bin/env bash
set -eu
# Gather command line options
SKIPTESTS
BUILDDIR
SKIPINSTALL
for i in $; do case $i in -skiptests|--skip-tests) # Skip tests portion of the buildSKIPTESTSYESshift;;-d*|--build-dir*) # Specify the directory to use for the buildBUILDDIR${i#*}shift;;-skipinstall|--skip-install) # Skip dpkg installSKIPINSTALLYES;;*)#TODO Maybe define a help section?;;esac
done# Use the specified build directory, or create a unique temporary directory
set -x
BUILDDIR${BUILDDIR:-$(mktemp -d)}
mkdir -p ${BUILDDIR}
cd ${BUILDDIR}# Download the source tarball from GitHub
sudo apt-get update
sudo apt-get install curl jq -y
git_tarball_url$(curl --retry 5 https://api.github.com/repos/git/git/tags | jq -r .[0].tarball_url)
curl -L --retry 5 ${git_tarball_url} --output git-source.tar.gz
tar -xf git-source.tar.gz --strip 1# Source dependencies
# Dont use gnutls, this is the problem package.
if sudo apt-get remove --purge libcurl4-gnutls-dev -y; then# Using apt-get for these commands, theyre not supported with the apt alias on 14.04 (but they may be on later systems)sudo apt-get autoremove -ysudo apt-get autoclean
fi
# Meta-things for building on the end-users machine
sudo apt-get install build-essential autoconf dh-autoreconf -y
# Things for the git itself
sudo apt-get install libcurl4-openssl-dev tcl-dev gettext asciidoc libexpat1-dev libz-dev -y# Build it!
make configure
# --prefix/usr
# Set the prefix based on this decision tree: https://i.stack.imgur.com/BlpRb.png
# Not OS related, is software, not from package manager, has dependencies, and built from source /usr
# --with-openssl
# Running ripgrep on configure shows that --with-openssl is set by default. Since this could change in the
# future we do it explicitly
./configure --prefix/usr --with-openssl
make CFLAGS-stdgnu99
if [[ ${SKIPTESTS} ! YES ]]; thenmake test CFLAGS-stdgnu99
fi# Install
if [[ ${SKIPINSTALL} ! YES ]]; then# If you have an apt managed version of git, remove itif sudo apt-get remove --purge git -y; thensudo apt-get autoremove -ysudo apt-get autocleanfi# Install the version we just builtsudo make install CFLAGS-stdgnu99 #install-doc install-html install-infoecho Make sure to refresh your shell!bash -c echo $(which git) ($(git --version))
fi