【问题标题】:git clone error: gnutls_handshake() failed: An unexpected TLS packet was receivedgit clone 错误:gnutls_handshake() 失败:收到了意外的 TLS 数据包
【发布时间】:2018-12-07 21:00:46
【问题描述】:

我在 armv7l 上运行 Ubuntu 18.04 LTS。我在代理中运行 git clone(我正确设置了代理变量),但现在我明白了;

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

它曾经在 Ubuntu 16.04 中工作。我已经检查了this solution,但它对我不起作用。我要做的就是 git clone。

【问题讨论】:

  • 您可能想查看this question 以帮助调试问题。即GIT_TRACE_PACKETGIT_CURL_VERBOSE=1 也可能会有所帮助。你使用 ssh 还是 https?
  • 检查@Nyambaa 解决方案here
  • @Rohan Khude 请再次阅读问题。以前试过,但只有我的答案有效
  • 干得好!在 Debian 10 上为我工作。

标签: git ubuntu-18.04


【解决方案1】:

gnutls 包可能有问题。我们必须用 openssl 而不是 gnutls 编译一个 git 包。 请按照以下步骤操作,

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

你可以关注This BogYou can find simple script here to do that

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
  • 是的。我愿意。谢谢。
  • 执行 sudo apt-get install -y libcurl4-openssl-dev 为我解决了这个问题。
  • 执行 sudo apt-get install -y libcurl4-openssl-dev 对我很有帮助
  • 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 成功了!
【解决方案2】:

终于找到答案了。看来我必须这样做:

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

在这方面花了一些时间,但幸运的是它最终奏效了。我认为这很难解决,但事实证明这是我以前在 Ubuntu 16.04 上从未做过的一些命令。

【讨论】:

  • 使用这个后得到Proxy CONNECT aborted
  • 什么是 my_proxy?
猜你喜欢
  • 1970-01-01
  • 2019-11-02
  • 2015-09-11
  • 1970-01-01
  • 2019-08-12
  • 2013-03-17
  • 1970-01-01
  • 1970-01-01
  • 2012-11-11
相关资源
最近更新 更多