git拉取github仓库报错fatal: unable to access 'https://xxx.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

git 拉取 github 仓库时,报错 gnutls_handshake() failed: The TLS connection was non-properly terminated.

搜索查阅参考文档,意识到是代理配置出了问题。

重置代理

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

重新配置代理,http协议和socket协议的配置分别如下,以8080端口为例

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

# socket
git config --global http.proxy 'socks5://127.0.0.1:8080'
git config --global https.proxy 'socks5://127.0.0.1:8080'

再git clone就能成功拉取了。

posted @ 2025-06-18 23:51  Wyny  阅读(24)  评论(0)    收藏  举报