git “致命:遇到 HttpRequestException。” 由于放弃 TLS-1.0 支持,GitHub/Bitbucket 存储库出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49067062/
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
"fatal: HttpRequestException encountered." Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
提问by Eric Bringley
Problem
问题
I recently encountered the following message when I pushed to a GitHub repo:
我最近在推送到 GitHub 存储库时遇到以下消息:
"fatal: HttpRequestException encountered. "
followed by being prompted for my username and password again.
"fatal: HttpRequestException encountered. "
然后再次提示我输入用户名和密码。
From previous searches, Visual Studioand various othershave the same root problem. For those lazier than I am, a summary of the various solutions for different applications/OS are here with relevant discussions. Hopefully people find this helpful.
从之前的搜索来看,Visual Studio和其他各种问题都存在相同的根本问题。对于那些比我更懒惰的人,这里汇总了针对不同应用程序/操作系统的各种解决方案,并进行了相关讨论。希望人们发现这有帮助。
Reason
原因
Can't really call updating sercurity a problem, so here's the reason. The issue is GitHub has removed TLS-1.0 support which is causing the problem with clients including Microsoft Visual Studio's built in git client, versions of Git below 1.14 as well as GUI clients includint tortoiseGit, etc. The full release notes can be found here: https://githubengineering.com/crypto-removal-notice/
不能真正将更新 sercurity 称为问题,所以这就是原因。问题是 GitHub 已删除 TLS-1.0 支持,这会导致客户端出现问题,包括 Microsoft Visual Studio 的内置 git 客户端、低于 1.14 的 Git 版本以及 GUI 客户端包括 tortoiseGit 等。完整的发行说明可以在这里找到: https://githubengineering.com/crypto-removal-notice/
Bitbucketwill drop TLSv1.0 and TLSv1.1 starting 1 Dec 2018. I expect similar problems as before.
Bitbucket将从 2018 年 12 月 1 日起放弃 TLSv1.0 和 TLSv1.1。我预计会出现与以前类似的问题。
Solution
解决方案
Edit: moved my self-answer to an answer box. See below.
编辑:将我的自我回答移至答案框。见下文。
采纳答案by Eric Bringley
Git hub has removed TLS-1.0 from it's authentication services. https://githubengineering.com/crypto-removal-notice/
Git hub 已从其身份验证服务中删除了 TLS-1.0。https://githubengineering.com/crypto-removal-notice/
Solutions
解决方案
Windows Clients
Windows 客户端
Use Version 2.14.3 (or newer) of Git for Windows and newer include an up-to-date Git Credential Manager for Windows: https://gitforwindows.org/
使用适用于 Windows 的 Git 2.14.3 版(或更高版本),更新版本包括适用于 Windows 的最新 Git 凭证管理器:https: //gitforwindows.org/
You can also explicitly update your Git Windows Credencial Manager to the latest version, 1.14.0, to get TLS-1.2 support: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0
您还可以将您的 Git Windows Credencial Manager 显式更新到最新版本 1.14.0,以获得 TLS-1.2 支持:https: //github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/ v1.14.0
Visual Studio Clients
Visual Studio 客户端
It is suggested to update your client to VS 2017 or, if you cannot upgrade, there are two machine-wide registry keys you can set that affect all .NET-based applications on the client machine that you can change... https://developercommunity.visualstudio.com/content/problem/201457/unable-to-connect-to-github-due-to-tls-12-only-cha.html
建议将您的客户端更新到 VS 2017,或者,如果您无法升级,您可以设置两个计算机范围的注册表项,这些注册表项会影响您可以更改的客户端计算机上所有基于 .NET 的应用程序... https:/ /developercommunity.visualstudio.com/content/problem/201457/unable-to-connect-to-github-due-to-tls-12-only-cha.html
JDK
JDK
TLS-1.2 is default in JDK8 and available in JDK7. https://blogs.oracle.com/java-platform-group/diagnosing-tls,-ssl,-and-https
TLS-1.2 在 JDK8 中是默认的,在 JDK7 中可用。 https://blogs.oracle.com/java-platform-group/diagnosing-tls,-ssl,-and-https
Red Hat native Git clients
红帽原生 Git 客户端
RH 5 does not support TLS-1.2 and GitHubEngineering suggest updating to newer versions of the OS. RH 6.8 and 7.2 will support TLS-1.2. https://www.linuxquestions.org/questions/blog/mensawater-183304/rhel5-wont-support-tlsv1-1-or-higher-36951/
RH 5 不支持 TLS-1.2,GitHubEngineering 建议更新到更新版本的操作系统。RH 6.8 和 7.2 将支持 TLS-1.2。https://www.linuxquestions.org/questions/blog/mensawater-183304/rhel5-wont-support-tlsv1-1-or-higher-36951/
回答by uncle-tee
Step 1 Firstly you need to download and install the latest version of the Git Windows Credential Manager.
步骤 1 首先,您需要下载并安装最新版本的 Git Windows Credential Manager。
Here is the link to it on GitHub. https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/latest
这是 GitHub 上的链接。https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/latest
Step 2 Restart your machine.
步骤 2 重新启动您的机器。
Step 3 Enter a git command in the command line and you will be prompted to login again.
步骤 3 在命令行中输入 git 命令,系统会提示您重新登录。
Step 4 If you still get the same fatal error, you will need to update Git by downloading the latest version from here: https://git-scm.com/downloads
第 4 步如果仍然出现同样的致命错误,则需要通过从此处下载最新版本来更新 Git:https: //git-scm.com/downloads
Step 5 Enter a git command in the command line and you will be prompted to login again. The problem should be solved now and you should be able to carry on working as normally.
步骤 5 在命令行中输入 git 命令,系统会提示您再次登录。现在问题应该已经解决了,您应该可以继续正常工作了。
回答by rockey91
TLS support is discontinued in older versions of git.
旧版本的 git 中不再提供 TLS 支持。
Upgrading git on your machine solves this problem.
在你的机器上升级 git 可以解决这个问题。
Download the latest gitand install for your machine from here: https://git-scm.com/downloads.
从这里下载最新的 git并为您的机器安装:https: //git-scm.com/downloads。
回答by Shubham Bichkar
Above solution does not work for me. But I have a solution for this, When git asks us for username again on git bash, enter your GITHUB username and password on git bash itself and you will be back on work.
以上解决方案对我不起作用。但是我对此有一个解决方案,当 git 在 git bash 上再次要求我们输入用户名时,在 git bash 本身上输入您的 GITHUB 用户名和密码,您将重新开始工作。