解决git gnutls_handshake失败

来源:互联网 发布:盐与避难所mac版 编辑:程序博客网 时间:2024/05/17 06:43

http://askubuntu.com/questions/186847/error-gnutls-handshake-falied-when-connecting-to-https-servers


解决git 无法clone的问题,错误提示如下

error: gnutls_handshake() failed: A TLS packet with unexpected length was received. while accessing ...fatal: HTTP request failed


Got reason of the problem, it was gnutls package. It's working weird behind a proxy. Butopenssl is working fine even in weak network. So workaround is that we should compilegit with openssl. To do this, run the following commands:

sudo apt-get install build-essential fakeroot dpkg-devmkdir ~/git-opensslcd ~/git-opensslsudo apt-get source gitsudo apt-get build-dep gitsudo apt-get install libcurl4-openssl-devsudo dpkg-source -x git_1.7.9.5-1.dsccd git_1.7.9.5 8.

Then, edit debian/control file (run the command: gksu gedit debian/control) and replace all instances oflibcurl4-gnutls-dev with libcurl4-openssl-dev

sudo dpkg-buildpackage -rfakeroot -b

(if it's failing on test, you can remove the line TEST=test from the filedebian/rules)

sudo dpkg -i ../git_1.7.9.5-1_i386.deb

Inspired from here http://code.google.com/p/wfuzz/wiki/PyCurlSSLBug


0 0
原创粉丝点击