解决拉取github仓库报错“gnutls_handshake() failed”问题 proxy

解决拉取github仓库报错“gnutls_handshake() failed”问题

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

最近为新配置的虚机拉取库,但是从 GitHub 拉取库总是出问题,查阅网上文献将问题锁定在代理,但是找了一圈还是没有找到答案。

经过仔细排查,发现还是由于代理设置有错,为 http 错误配置了 https 的代理,导致出错。

如果没有配置代理,可使用以下命令 取消代理 :

git config --global --unset http.proxy
git config --global --unset https.proxy

如果需要使用 代理 , 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
git config --global http.proxy http://192.168.12.1:1234

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
posted @   michaelchengjl  阅读(901)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
点击右上角即可分享
微信分享提示