3

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
Community
  • 1
  • 1
pajooh
  • 1,916
  • 2
  • 18
  • 17
  • could we see the git command you entered? – Franck Dec 04 '13 at 11:13
  • @Frank: gihub.com fails at all. e.g. https://github.com/openssl/openssl – pajooh Dec 04 '13 at 12:38
  • 1
    Did you look at this article? http://askubuntu.com/questions/186847/error-gnutls-handshake-falied – Franck Dec 04 '13 at 12:42
  • @Frank: did you even read my question to the end? i've already used your link in my question – pajooh Dec 04 '13 at 14:41
  • I had the same problem and I used 2 VMs V1,V2 at the same time. With V2 I wanted to clone a repo (and run in the same error from above) and V1 run a service (nothing important). But I used a NAT network configuration and something must gone wrong. So I tried to shutdown V1 and voila V2 could connect via https to github. Maybe this helps a bit. – tingel2k Feb 21 '14 at 13:26
  • please provide the output of command `env GIT_CURL_VERBOSE=1 git clone https://github.com/foo/bar.git` – shawnzhu Mar 11 '14 at 22:03

1 Answers1

0

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/