Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git and "Server aborted the SSL handshake" errors

Tags:

git

github

ssh

ssl

Often when I want to push to my private repo I get a "Server aborted the SSL handshake" error. After several tries it often suddenly works. I was yet not able to find a solution on the internet.

If this weren't annoying enough today I wanted to install torch via git clone https://github.com/torch/distro.git ~/torch --recursive

It fails every time at the public cutorch.git

fatal: unable to access 'https://github.com/torch/cutorch.git/': Server aborted the SSL handshake fatal: clone of 'https://github.com/torch/cutorch.git' into submodule path 'extra/cutorch' failed

However when I execute this line by myself it works fine:

git clone https://github.com/torch/cutorch.git/ extra/cutorch

Now I have to restart the install process which fails because the folder already exists. So no torch for me unless this is fixed?

I have the latest version of git(2.8.1) installed and use Mac OS 10.11.4.

How do I fix this annoying SSL handshake error?

Update: It may be caused by my ISP. I have had phases where I had problems with HTTPS and iTunes Store connections as well.

like image 800
Benedikt S. Vogler Avatar asked Apr 29 '16 11:04

Benedikt S. Vogler


People also ask

What does SSL handshake aborted mean?

A TLS/SSL handshake failure occurs when a client and server cannot establish communication using the TLS/SSL protocol.


2 Answers

This may help you:

Generate SSH Key: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Then add it your git account: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

like image 181
Amir Suhail Avatar answered Oct 30 '22 12:10

Amir Suhail


Often when I want to push to my private repo I get a "Server aborted the SSL handshake" error. After several tries it often suddenly works. I was yet not able to find a solution on the internet :(

It might be a problem of the different ssl version you are using.

In order to fix it generate a new ssl (RSA) certificate, and update your GitHub account with this new certificate.

Here is how to set it up:

  • Generate a new ssh key. *Set the -t to rsa in order to avoid future connection problems.

    ssh-keygen -t rsa
    
  • Once you have your generated in your %HOME%/.ssh directory ( windows: Users/<your user>.ssh), open it and copy the content of the <keyname>.pub


How to set up ssh key under your GitHub account?

  • Login to GitHub account
  • Click on the rancher on the top right (Settings)
    enter image description here
  • Click on the SSH keys and GPG Keys
    enter image description here
  • Click on the New SSH key
    enter image description here
  • Paste your key and save

Note

After the first set up open terminal and run a git fetch so the key will be tested and added to your known hosts file.

like image 23
CodeWizard Avatar answered Oct 30 '22 11:10

CodeWizard