Git pull/push-无法访问 HTTPS,SSL 例程似乎停止了

我每天都在使用 Git (和 GitHub) ,一切都很正常,突然之间,我不能再通过 Git 命令与远程 GitHub 存储库通信了。当我尝试“ Git pull”时,它会出现以下错误:

致命: 无法进入「 https://github.com/snahrvar/eatibl.git/」 : Error: 1407742E: SSL 例程: SSL23 _ GET _ SERVER _ HELLO: tlsv1 alert 协议版本

因此,我在多个存储库中进行了测试,在我的计算机上得到了相同的错误。我让其他人与这些相同的存储库进行交互,这对他们来说工作得很好。在出现这个错误之前,我在一个项目上执行了“ npm install Sharp”,结果失败了,我怀疑这可能会扰乱一些 SSL 设置,但这是一个大胆的猜测!

任何一般性的想法或指导将不胜感激!

如果有帮助的话,这是我的环境:

  • Git 版本: 1.9.4. msysgit. 2
  • Windows 版本: Windows 8.1
66432 次浏览

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

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!)

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.

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

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

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.

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.

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.

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.

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.

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

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.)

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

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

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.

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.

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

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.

I also came across to this problem recently

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