Git pull/push - 无法访问 HTTPS,SSL 例程似乎已关闭

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48938019/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:14:25  来源:igfitidea点击:

Git pull / push - unable to access HTTPS, SSL routines seem to be down

gitgithub

提问by Shayan Nahrvar

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:

我每天都在使用 Git(和 GitHub)并且一切正常,突然之间,我无法再通过我的 Git 命令与我的远程 GitHub 存储库进行通信。当我尝试“Git pull”时,出现以下错误:

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

致命:无法访问“ https://github.com/snahrvar/eatibl.git/”:错误:1407742E:SSL 例程:SSL23_GET_SERVER_HELLO:tlsv1 警报协议版本

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!

因此,我在多个存储库中进行了测试,并且在我的计算机上遇到了相同的错误。我让其他人与这些相同的存储库进行了交互,这对他们来说效果很好。在出现此错误之前,我对一个项目进行了“npm installSharp”,但最终失败了,我怀疑这可能与某些 SSL 设置有关,但这是一个疯狂的猜测!

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
  • Git 版本:1.9.4.msysgit.2
  • Windows 版本:Windows 8.1

采纳答案by feos

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

根据@Frederic 在评论中的建议,更新 TortoiseGit 和 GCM 对我没有帮助,但更新 Git 本身却有帮助。

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

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.

为了确保新版本的 Git 正确安装并且不与以前的安装冲突(如果您使用 TortoiseGit,可能会使用不同的文件夹并弄乱 PATH 变量),请在安装更新的 Git 之前删除现有的 Git 安装. 可能还需要以管理员权限安装。

回答by Anthony L

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

您可能会遇到与 GitHub 弃用弱 SSL 加密协议的不兼容问题:

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

解决方案会有所不同,但对于 Windows,您可能需要将 Git 凭据管理器升级到 1.14.0

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

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

回答by humazed

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

如果您使用的是Android Studio 或IntelliJ IDEA,请将Git 更新到最新版本并将路径更改为指向新版本为我解决问题。

Enter image description here

在此处输入图片说明

回答by MJWitte

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

使用 TortoiseGit,我完成了为此给出的所有其他修复/更新,但仍然没有成功。我发现了这一点:不能突然 git push/pull/fetch

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\binand now it's working again.

我为 Windows Git.exe 路径设置的 Git TortoiseGit 设置指向C:\Program Files (x86)\Git\bin. 我把它改成了C:\Program Files\Git\bin,现在又可以工作了。

回答by Raymond van Rijs

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

在我的情况下,更新 Git 是不够的。经过几个小时的调试,这是我的修复:

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

回答by dgundersen

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
  1. 从这里安装最新版本的 Git:https: //git-scm.com/download/win
  2. 在 TortoiseGit 中,转到菜单SettingsGeneralGit.exe Path- 将其从 32 位更改为 64 位路径:C:\Program Files (x86)\Git\bin → C:\Program Files\Git\bin

回答by Bolu Ajibawo

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

我在Visual Studio Code终端上从 GitHub 提取代码时遇到了同样的问题。我发现之前答案中的建议很有用,并按照以下步骤一起破解了一个解决方案:

This repositorywas quite useful.

这个存储库非常有用。

I hope this helps someone.

我希望这可以帮助别人。

回答by Mike Makarov

TL;DR: git config --system http.sslbackend schanneland switch off HTTPS checks for github.comin your antivirus software

TL;DR:git config --system http.sslbackend schannel并关闭github.com防病毒软件中的HTTPS 检查



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

我在 Windows 8 x64 上使用 Git 命令行。此外,我的防病毒软件默认会检查 HTTPS 流量。和回答这个问题的其他人一样,我几乎每天都使用 GitHub。

  • Updating Git - didn't help - because I used OpenSSL (see below)
  • Updating credential manager - didn't help
  • 更新 Git - 没有帮助 - 因为我使用了 OpenSSL(见下文)
  • 更新凭证管理器 - 没有帮助

Then I started playing with switching the SSL backend:

然后我开始尝试切换 SSL 后端:

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

git config --system http.sslbackend openssl ----------------vs------------------ git config --system http.sslbackend schannel 并且防病毒软件会检查 SSL 流量:

  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
  1. OpenSSL,HTTPS 检查开启: error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01
  2. OpenSSL,HTTPS 检查关闭: SSL certificate problem: unable to get local issuer certificate
  3. SecureChannel,HTTPS 检查开启: schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
  4. SecureChannel,HTTPS 检查关闭:工作正常

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

PS:您可以重新安装最新的 Git,而不是命令行,选择“使用本机 Windows SSL 验证库”。

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.

PPS:案例(3)似乎是schannel库中的一个bug,因为我的杀毒软件使用的MITM证书在我的机器上被列入白名单。

回答by Thomas M

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.

是的,我今天在拉取请求中遇到了同样的问题,解决方案是通过下载适用于 Windows 的最新 (2.16.2) 64 位版本的 Git 来简单地更新 Git。它于 5 天前发布,于 2018-02-20。

回答by Dead End

The comment by @andw worked for me:

@andw 的评论对我有用:

Update Git version 1.9.5 to 2.15.1 using these steps:

使用以下步骤将 Git 版本 1.9.5 更新到 2.15.1:

In sourceTree, go to menu ToolsOptionsGitUse Embedded Git.

在 sourceTree 中,转到菜单ToolsOptionsGitUse Embedded Git