经常遇到github clone文件的时候提示gnutls_handshake() failed的问题,网上找了一遍,有几种方法,记录一下:
1:https改为git
2:https改为http
参考Git gnutls_handshake() failed解决办法 - osc_yabfjcbk的个人空间 - OSCHINA - 中文开源技术交流社区
实测有效。
3:用git config命令配置sslVerify为false
git config http.sslVerify "false"
我的项目由于是python脚本自动下载,所以尝试第三种方法,没有成功
4:增加用户信息,然后再git,这次成功
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
但是拉取几个repo之后,又不行了
5:取消或者设置代理
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
使用代理
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
取消代理,还是不行
6:采用openssl替代gnutls
参考
似乎这是最后的解决方法了