git clone: fatal: gnutls_handshake() failed

7.1k views Asked by At

recently, trying to clone a git repo from my debian(jessie) box, i'm facing this:

fatal: unable to access 'https://github.com/foo/bar/': gnutls_handshake() failed: A TLS packet with unexpected length was received.

as mentioned by ubuntu folks i used the git compiled with openssl, and now i get:

fatal: unable to access 'https://github.com/foo/bar/': Unknown SSL protocol error in connection to github.com:443
1

There are 1 answers

0
Frederick Ollinger On

The client side solutions work great.

However, it's not always practical to ask everyone to recompile their base git executable when we could just fix things on the server and be done with it.

(NOTE: This only works if you have admin access to your git server.)

Edit:

/etc/apache2/sites-enabled/config-file-whatever-it-is.conf

And add ServerName my.sampleserver.com

ServerName reference:

https://httpd.apache.org/docs/current/vhosts/name-based.html

Special thanks to for the solution:

https://www.progclub.org/blog/2014/09/03/gnutls_handshake-failed-using-git/