Git gnutls_handshake() failed解决办法

今天在git clone的时候遇到了Git gnutls_handshake() failed的问题:

$ git clone https://github.com/intel/igvtg-qemu
Cloning into 'igvtg-qemu'...
fatal: unable to access 'https://github.com/intel/igvtg-qemu/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

解决方案:

很简单,把https换成http:

$ git clone http://github.com/intel/igvtg-qemu
Cloning into 'igvtg-qemu'...
warning: redirecting to https://github.com/intel/igvtg-qemu/
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (43/43), done.

其实出现这个问题,很大可能是因为https和http的proxy的对应的分别是https和http开头的proxy server,而https的proxy server可能无法正常工作。一个work around是把https的proxy server换成http的proxy server:

git config --global https.proxy <Your http proxy server>
git config --global http.proxy <Your http proxy server>

#The ~/.gitconfig should reflect these entries as:
[http]
        proxy = <Your http proxy server>
[https]
        proxy = <Your http proxy server>

 

 

posted @ 2019-08-09 15:42  青山牧云人  阅读(28767)  评论(3编辑  收藏  举报