主页 M

linux中git clone读github仓库报错gnutls_handshake () failed解决方案

2022-02-14 网页编程网 网页编程网

1.报错背景

ubuntu中,执行git clone https://github.com/mininet/mininet.git读取github仓库源码时,报错如下:

gnutls_handshake() failed: The TLS connection was non-properly terminated.

由于代理设置有错,为 http 错误配置了 https 的代理,导致出错。

2.没有配置代理,可使用以下命令取消代理

git config --global --unset http.proxy

git config --global --unset https.proxy

3.需要使用代理 ,http协议通过以下命令配置,使用7890端口为例

git config --global http.https://github.com.proxy http://127.0.0.1:7890

git config --global https.https://github.com.proxy https://127.0.0.1:7890

4.socket协议通过以下命令配置,使用7890端口为例

git config --global http.proxy 'socks5://127.0.0.1:1080'

git config --global https.proxy 'socks5://127.0.0.1:1080'

也可以这样子仅代理GitHub

git config --global http.https://github.com.proxy socks5://127.0.0.1:1080

#取消代理

git config --global --unset http.https://github.com.proxy

阅读原文
阅读 4833
123 显示电脑版