Git:gnutls_handshake() failed: A TLS packet with unexpected length was received

Q:

git 克隆代码时报错,

gnutls_handshake() failed: A TLS packet with unexpected length was
received

A:
链接:https://askubuntu.com/questions/186847/error-gnutls-handshake-failed-when-connecting-to-https-servers/187199#187199
解决步骤如下
1.重新编译,注意修改为你下载的对应版本号

sudo apt-get install build-essential fakeroot dpkg-dev libcurl4-openssl-dev
sudo apt-get build-dep git
mkdir ~/git-openssl
cd ~/git-openssl
apt-get source git
dpkg-source -x git_1.7.9.5-1.dsc
cd git-1.7.9.5

2.修改“debian/control”文件,把所有的“libcurl4-gnutls-dev” 替换成“libcurl4-openssl-dev”

sudo dpkg-buildpackage -rfakeroot -b

3.安装对应的版本

i386: sudo dpkg -i ../git_1.7.9.5-1_i386.deb
x86_64: sudo dpkg -i ../git_1.7.9.5-1_amd64.deb

你可能感兴趣的:(Q&A)