简体   繁体   English

git clone 错误:gnutls_handshake() 失败:收到了意外的 TLS 数据包

[英]git clone error: gnutls_handshake() failed: An unexpected TLS packet was received

I am running Ubuntu 18.04 LTS on armv7l.我在 armv7l 上运行 Ubuntu 18.04 LTS。 I am running git clone inside a proxy (I got the proxy variables set properly), but now I get this;我在代理中运行 git clone (我正确设置了代理变量),但现在我明白了;

fatal: unable to access '<my_git>.git/': gnutls_handshake() failed: An unexpected TLS packet was received.

It used to work in Ubuntu 16.04.它曾经在 Ubuntu 16.04 中工作。 I have checked this solution but it does not work for me.我已经检查了这个解决方案,但它对我不起作用。 All I am trying to do is to git clone.我想要做的就是 git clone。

Finally found the answer.终于找到了答案。 It seems that I have to do:看来我必须这样做:

git config --global http.proxy http://<my_proxy>:<my_port>
git config --global https.proxy https://<my_proxy>:<my_port>

Spent quick some time on this but luckily it works in the end.在这方面花了一些时间,但幸运的是它最终奏效了。 I thought this would be hard to fix but it turns out to be some commands that I never did before on Ubuntu 16.04.我认为这很难解决,但事实证明这是我以前在 Ubuntu 16.04 上从未执行过的一些命令。

Might be issue with gnutls Package.可能是gnutls包的问题。 we have to compile a git Package with openssl instead of gnutls.我们必须用 openssl 而不是 gnutls 编译一个git包。 Follow the below steps,按照以下步骤,

sudo apt-get install -y build-essential fakeroot dpkg-dev
sudo apt-get -y build-dep git
sudo apt-get install -y libcurl4-openssl-dev

mkdir git-openssl
cd git-openssl
apt-get source git
cd git-*
sed -i -e 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/g' 
./debian/control
sed -i -- '/TEST\s*=\s*test/d' ./debian/rules
sudo dpkg-buildpackage -rfakeroot -b
sudo dpkg -i git_2.7.4-0ubuntu1.6_arm64.deb

#CleanUp
cd ../../
sudo rm -rf git-openssl

You can follow This Bog or You can find simple script here to do that你可以按照这个沼泽或者你可以在这里找到简单的脚本来做到这一点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM