108

I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:

fatal: unable to access 'https://github.com/snahrvar/eatibl.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!

Any general thoughts or guidance would be much appreciated!

If it's helpful at all, here is my environment:

  • Git version: 1.9.4.msysgit.2
  • Windows version: Windows 8.1
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shayan Nahrvar
  • 1,083
  • 2
  • 7
  • 5

19 Answers19

73

Updating TortoiseGit and GCM didn't help me, but updating Git itself did, as per @Frederic's advice in comments.

https://git-scm.com/download/win

To make sure the new version of Git installs properly and doesn't conflict with previous installations (it might, if you used TortoiseGit's, because it would use different folders and mess with PATH variable), remove the existing Git installation before installing the updated Git. Might also need to install with administrator rights.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
feos
  • 1,099
  • 1
  • 9
  • 19
  • I'm not sure what happened with the last version of git to start throwing these errors today but this answer is it for me. I took a fresh install (2 day old build) and I'm back up and running no ssl errors. Talk about a needle in the haystack. – JeffBaumgardt Feb 23 '18 at 23:56
  • 3
    The most interesting part is that github themselves aren't mentioning this, even though it's likely related to their recent updates. Quick google search regarding similar problems with other code hostings blames OpenSSL. – feos Feb 24 '18 at 07:39
  • Yep, just needed to update to the latest version! Thanks :D – Shayan Nahrvar Feb 25 '18 at 20:07
  • Updating didn't resolve my problems! am now getting error setting certificate verify locations: CAfile: /mingw64/ssl/certs/ca-bundle.crt CApath: none – gath Feb 28 '18 at 09:46
  • 1
    @gath You probably have 2 incompatible installations of git, try uninstalling the existing one fully, then reinstall git from scratch. But your error is a different one https://stackoverflow.com/questions/3778042/github-error-cloning-my-private-repository – feos Feb 28 '18 at 17:23
  • 5
    For me "remove the existing Git installation before installing the updated Git" was the key to this whole debacle. – Richard Ockerby Mar 28 '18 at 13:25
  • updated to the latest version after years, worked like a charm – Danyal Sandeelo Aug 29 '19 at 19:03
20

You're likely running into an incompatibility with GitHub's deprecation of weak SSL encryption protocols:

Weak cryptographic standards removal notice

The solution will vary, but for Windows you likely need to upgrade the Git credential manager to 1.14.0

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Anthony L
  • 2,159
  • 13
  • 25
  • 1
    Will they continue to support the built-in Git credential manager for windows: wincred. I'm getting the same error with that tool – Max Hartshorn Feb 22 '18 at 22:35
  • This answer helped to provide context about the change, but the solution from @feos is the one that worked for me (Windows 10, TortoiseGit) – Eric Farraro Feb 23 '18 at 20:22
14

If you are using Android Studio or IntelliJ IDEA, updating Git to the latest version and changing the path to point to the new version solve the problem for me.

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
humazed
  • 74,687
  • 32
  • 99
  • 138
8

Using TortoiseGit, I did all of the other fixes/updates given for this and still no success. I found this: Can't git push/pull/fetch suddenly

My TortoiseGit settings for Git for Windows Git.exe path was pointing to C:\Program Files (x86)\Git\bin. I changed it to C:\Program Files\Git\bin and now it's working again.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
MJWitte
  • 81
  • 2
  • 3
    I checked it using `Check now` button in `General` settings dialog, with the `x86` path I have get `git version 1.9.5.msysgit.1`, after changing to `C:\Program Files\Git\bin` I have get `git version 2.16.2.windows.1` and with that path all works fine. – apdevelop Feb 24 '18 at 14:42
8

This is what worked for me.

  1. Install the latest version of Git from here: https://git-scm.com/download/win
  2. In TortoiseGit, go to menu SettingsGeneralGit.exe Path - change it from 32-bit to 64-bit path: C:\Program Files (x86)\Git\bin → C:\Program Files\Git\bin
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
dgundersen
  • 447
  • 3
  • 16
8

Updating Git was not enough in my situation. After debugging for several hours, this was my fix:

C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.0

C:\wamp64\www\maandlastenmanager> git config http.sslVersion tlsv1.2

C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.2
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • This solved the issue for me, and on a completely different setup (Mac OS X). `curl` still gives me the message, which makes me wonder if there is a setting like that that goes for all ssl-apps, not just `git`... – chesterbr Apr 02 '18 at 16:54
  • Which one of these lines? – Dmitri Zaitsev Apr 06 '18 at 16:29
2

I had this same problem while pulling code from GitHub on my Visual Studio Code terminal. I found the advice in the previous answers useful and hacked a solution together following the steps below:

This repository was quite useful.

I hope this helps someone.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
2

TL;DR: git config --system http.sslbackend schannel and switch off HTTPS checks for github.com in your antivirus software


I'm using the Git command line on Windows 8 x64. In addition, my antivirus software checks HTTPS traffic by default. Like other people in answering this question, I use GitHub almost daily.

  • Updating Git - didn't help - because I used OpenSSL (see below)
  • Updating credential manager - didn't help

Then I started playing with switching the SSL backend:

git config --system http.sslbackend openssl ----------------vs------------------ git config --system http.sslbackend schannel and the antivirus software checks for SSL traffic:

  1. OpenSSL, HTTPS checks ON: error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01
  2. OpenSSL, HTTPS checks OFF: SSL certificate problem: unable to get local issuer certificate
  3. SecureChannel, HTTPS checks ON: schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
  4. SecureChannel, HTTPS checks OFF: worked fine

P.S.: Instead of commandline, you can just reinstall the latest Git, selecting "Use native Windows SSL validation library".

P.P.S.: The case (3) seems to be a bug in the schannel library, because the MITM certificate my antivirus software uses is whitelisted on my machine.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mike Makarov
  • 1,287
  • 8
  • 17
  • When reinstalling git, I completely removed its old installation, and for the new installation, I picked OpenSSL, so I guess it reinstalled it from scratch. But I don't have an antivirus. Did reinstallation of the SSL backend change anything for you, or you didn't do it? – feos Feb 25 '18 at 08:39
  • @feos Yes, it only works for me in non-OpenSSL mode. Plus, I had to turn off https checks in AV. – Mike Makarov Feb 25 '18 at 22:30
  • It's still unclear to me, did you reinstall SSL or not? – feos Feb 25 '18 at 22:59
  • @feos No I did not. I don't think one can "reinstall SSL" on Windows. So not sure what you mean by this. When you install latest git client, you have an option to chose - OpenSSL backend or Windows integrated one. I chose OpenSSL. That didn't work and I changed the backend through the configuration. Hope this clarifies. – Mike Makarov Feb 26 '18 at 10:40
  • It does, thanks. I think you were having an entirely different problem than the OP. – feos Feb 26 '18 at 14:49
1

Same for me with Git 1.9.5.msysgit.1 too. I tried to install https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0, but no change.

Actually, nothing happen after installation; maybe I'm doing something wrong? (That may not help for the initial question, but for other people, yes!)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Frederic
  • 145
  • 2
  • 11
  • 6
    Just to help the community, i just updated git (for windows) (with https://git-scm.com/download/win) and it solved the problem ! – Frederic Feb 22 '18 at 22:48
  • 2
    Under Windows 7 Pro/64, I upgraded git using the link the git-scm.com/download/win link. This installed git to c:\program files\git rather than c:\program files (x86)\git. My version changed from 1.9.5.msysgit.1 to 2.16.2.windows.1 and when I configured WebStorm to point to the newer version, the mysterious _1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version_ error ceased. – CODE-REaD Feb 23 '18 at 00:43
  • FYI, my setup is: `C:\Program Files\Git\etc> cat install-options.txt Editor Option: Notepad++ Path Option: Cmd Plink Path: C:\Program Files (x86)\PuTTY\plink.exe SSH Option: Plink CURL Option: OpenSSL CRLF Option: CRLFAlways Bash Terminal Option: MinTTY Performance Tweaks FSCache: Enabled Use Credential Manager: Enabled Enable Symlinks: Disabled` – CODE-REaD Feb 23 '18 at 02:07
  • You should make your encouragement to upgrade an answer. – Edward Thomson Feb 25 '18 at 01:11
1

On macOS, you can install the latest git via Homebrew.

A S
  • 1,195
  • 2
  • 12
  • 26
  • Unfortunately this didn't work for me on Mac OS X 10.7.5 (Lion) -- got the same error. I then tried installing `Homebrew` from scratch -- it seems to be a catch22. `error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/Homebrew/brew/info/refs?service=git-upload-pack fatal: HTTP request failed ` – Setaa Feb 28 '18 at 21:35
  • @Setaa, Well, may be try to install it manually from the Releases page then? They seem have addressed that catch22 in [1.5.5](https://github.com/Homebrew/brew/pull/3837) – A S Mar 02 '18 at 05:18
  • 1
    If anyone is trying to install git on an older Mac OS X like Snow Leopard, use [Tigerbrew](https://github.com/mistydemeo/tigerbrew) (a fork of Homebrew specifically intended for supporting older Macs) – Andrew Sep 28 '21 at 20:41
1

Yeah, I encountered the same issue on a pull request today and the solution was to simply update Git by downloading the latest (2.16.2) 64-bit version of Git for Windows. It was released 5 days ago, on 2018-02-20.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Thomas M
  • 319
  • 2
  • 6
1

The comment by @andw worked for me:

Update Git version 1.9.5 to 2.15.1 using these steps:

In sourceTree, go to menu ToolsOptionsGitUse Embedded Git.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dead End
  • 547
  • 2
  • 4
  • 17
1

A quick solution would be git config --global http.sslVerify true, but it is not recommended as it defeats the purpose using SSL.

A second and better way is to use ssh keys rather than an SSL URL.

Steps to generate SSH keys

o Run the following command in a Git terminal (Git Bash): ssh-keygen

After running the command, the following message will appear:

Generating public/private RSA key pair.

Enter file in which to save the key (/h//.ssh/id_rsa):

Give the path for the key to be stored in, for example, enter the file in which to save the key (/h//.ssh/id_rsa): C:\Users\Public\my-new-ssh-key

Then give the passphrase for that key (any password of minimum 8 characters)

• Next run the following command: eval “$(ssh-agent –s)”

• Run the following command: ssh-add C:/Users/Public/my-new-ssh-key Note: use forward slash in the path to the newly created SSH key.

After that, add the contents of the file my-new-ssh-key.pub and add it in the text area for Add public key (Bitbucket, GitHub, etc.)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

While connecting to a remote repository to fetch, pull, push, etc., I had the same error:

fatal: unable to access 'https://github.com/repository.git/': error:1
407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

I just reinstalled Git 64-bit in place of 32-bit and that fixed the issue.

After installation, verify the Git path in environment variables. It should be:

C:\Program Files\Git\bin\git.exe
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pratap Singh
  • 401
  • 1
  • 4
  • 14
0

This is an issue with IntelliJ and RubyMine. GitHub must have disabled SSL (PCI compliance maybe?) in favor of TLS. If you open Settings in IntelliJ or RubyMine and navigate to Version Control > Git, you'll see it's using a git.exe installed under the application's path. You should download the most current version of Git and change the path in your VCS settings to point to that, e.g. C:\Program Files\Git\bin\git.exe if you install it on Windows. Works like a charm after that.

0

Sometimes, this is caused by outdated msysgit which is using old ssl and not maintained any more, you can install latest git for windows, and point the git.exe path in tortoise setting to it, then this problem gone.

Benny
  • 8,547
  • 9
  • 60
  • 93
0

Git version upgrade did the trick for me. I had the version 1.9.5 and so and I upgraded to 2.21.0 on windows. Also upgrading is very easy. We don't need to uninstall the older version. Download the latest Git installer and just keep on pressing next using default options and the version will be changed to new version and all the old settings will still be working like ssh keys etc. We don't need to generate the keys again and put on github or any other repository.

Earlier my https protocol cloning was not working and giving error

fatal: unable to access 'https://github.com/tensorflow/models/': error:1407742E: SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Once I downloaded new version and ran the same clone command it worked without any issues.

Cà phê đen
  • 1,883
  • 2
  • 21
  • 20
AKumar
  • 21
  • 3
0

I also came across to this problem recently

What worked for me was to revert an automatic update of git

RSFalcon7
  • 2,241
  • 6
  • 34
  • 55
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 10 '21 at 15:03
-1

Encountered a similar error. On windows, Updated git on windows to the latest version. That fixed the problem.

Olusola Omosola
  • 847
  • 9
  • 9