Git Error: gnutls_handshake() failed


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

Solution: need to rebuild git with openssl

sudo apt-get install build-essential fakeroot dpkg-dev
mkdir ~/git-openssl
cd ~/git-openssl
sudo apt-get source git
sudo apt-get build-dep git
sudo apt-get install libcurl4-openssl-dev
sudo dpkg-source -x git_1.7.9.5-1.dsc
cd git_1.7.9.5 8.
sudo vi debian/control
# replace libcurl4-gnutls-dev with libcurl4-openssl-dev
sudo dpkg-buildpackage -rfakeroot -b
# if this is failed, remove TEST=test from debian/rules
sudo dpkg -i ../git_1.7.9.5-1_i386.deb

This is the solution from


2 thoughts on “Git Error: gnutls_handshake() failed

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s