TLS connection terminated when doing git clone - zhouyoujoin/ubuntu GitHub Wiki

When I'm starting clone a repository from github.com, I got an error message like this,

error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.

It's the Gnutls_handshake() failure, the next step can rectify this issue.

1. Install build-essential, fakeroot and dpkg-dev

sudo apt-get install build-essential fakeroot dpkg-dev

2. Create a directory for hold the source file for git

mkdir ~/git-rectify
cd ~/git-rectify
apt-get source git

3. Install all the git dependencies

sudo apt-get build-dep git
sudo apt-get install libcurl4-openssl-dev

4. Rebuild git from source

dpkg-source -x git_2.7.4-0ubuntu1.3.dsc

5. Uing openssl version to substitute gnu version

cd into "git-2.7.4" and open the control file locate inside debian folder "git-2.7.4/debian/control" in a text editor. Replace all the occurrences of "libcurl4-gnutls-dev" to "libcurl4-openssl-dev". Also open "debian/rules" file and delete the line "TEST=test"

6. Building package for git*.deb, and install it.

sudo dpkg-buildpackage -rfakeroot -b -uc -us
sudo dpkg -i ../git_2.7.4-0ubuntu1.3-amd64.deb