The system is Ubuntu (kylin) 20.04 and git version 2.25.
The following error is reported when the GIT clone the warehouse on the GitHub,
fatal: cannot access' https://github.com/xxx/yyy.git ': gnutls_handshake() failed: Decryption has failed.
Repeated many times.
Most of the failures of GIT clone are network problems, especially when using GitHub.
First try the proxy, http_ proxy，https_ Proxy, GIT config, http.proxy and other commonly used methods have been tried, and even the hack method of proxychains has been tried, but the results are not good. Instant confidence is gone.
Things are different this time.
There are two methods to recompile. One is to use the script provided by the boss . The second is to use the source code in apt to compile and package DEB by myself. I refer to   two tutorials. The general method is
1. Open source
2. Get the source code
apt source git , and modify libcurl4 gnutls dev in Debian/control file to libcurl4 OpenSSL dev.
3. Install the compilation environment,
sudo apt get build dep git
dpkg buildpackage - B, after a long compilation and a complete set of tests, several Debs are finally packaged. (there are still a few mistakes, regardless)
5. Install the packaged DEB,
dpkg - I Git_xxx.deb
Finally, it’s done. Git clone is very slow, but no decryption error is reported. The proxy is set successfully. The last step,
apt mark hold git, prevents git from being automatically updated. That’s it.
The specific cause of the error has not been thoroughly studied, and it looks more complex. Therefore, a workaround was taken and recorded here. Thank all the original authors.
1. It has been verified that git in livecd (Ubuntu kylin 20.04 Pro) still has this bug. In Galaxy Kirin V10 Sp1 livecd, the installed git also has this bug
2. The GIT of desktop (Intel processor) virtual machine and livecd is normal, so it is suspected that it is a hardware problem
3. Gitee does not have this problem
It is speculated that it is a hardware problem, or even a problem with the CPU instruction set. The bottom layer of TLS uses AES algorithm, and there are related instruction sets in CPU. Gitee has no problem, probably because it uses TLS 1.2 and GitHub is TLS 1.3.
- [Solved] Git clone https:// gnutls_handshake() failed: The TLS connection was non-properly terminated.
- [Solved] Git Error: GnuTLS recv error (-110): The TLS connection was non-properly terminated
- [Solved] pycurl.error: (35, ‘gnutls_handshake() failed: An unexpected TLS packet was received.’)
- Clone code from GitHub website — unable to find remote helper
- error: RPC failed; curl 18 transfer closed with outstanding read data remaining
- Failed to connect to github.com port 443:connection timed out
- Error in installing Python package — readtimeouterror
- Failed to connect to github.com port 443: Timed out(Windows)
- [Solved] Fatal error: OpenSSL/EVP. H: there is no such file or directory
- Linux: How to Solve Git clone error