Git Clone:连接到 github.com:443 时出现未知的 SSL 协议错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43334847/
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-19 12:42:25  来源:igfitidea点击:

Git Clone : Unknown SSL protocol error in connection to github.com:443

gitgithub

提问by Ankur

I am trying to clone a GitHub project in my office system.

我正在尝试在我的办公系统中克隆一个 GitHub 项目。

set HTTPS_PROXY=http://<UN>:<PWD>@<PROXYSERVER>:<PORT>
set HTTP_PROXY=http://<UN>:<PWD>@<PROXYSERVER>:<PORT>

I have set HTTPS and HTTP proxies also set sslVerify to false

我已经设置了 HTTPS 和 HTTP 代理也将 sslVerify 设置为 false

[https]
    sslVerify = false
[http]
    sslVerify = false

still, I am getting "Unknown SSL protocol error in connection to github.com:443".

尽管如此,我还是收到“与 github.com:443 相关的未知 SSL 协议错误”。

Can someone advise me what do I need to do?

有人可以告诉我我需要做什么吗?

回答by VonC

Make sure to use the latest Git (2.12.2) to check if the issue persists.

确保使用最新的 Git (2.12.2) 检查问题是否仍然存在。

If it does, see the various settings I mention in "Unknown SSL protocol error in connection" in order to debug this:

如果是这样,请查看我在“连接中的未知 SSL 协议错误”中提到的各种设置,以便调试:

# Windows
set GIT_CURL_VERBOSE=1
set GIT_TRACE_PACKET=2

# Unix
export GIT_CURL_VERBOSE=1
export GIT_TRACE_PACKET=2

Update Feb. 2018: after issue 587(Disable TLSv1.0 and Disable Cipher), this is finally in place: no more TLSv1.0.
See "Discontinue support for weak cryptographic standards", updated in 2018 with "Weak cryptographic standards removal notice".

2018 年 2 月更新:在问题 587(禁用 TLSv1.0 和禁用密码)之后,这终于到位:不再有 TLSv1.0。
请参阅“停止支持弱密码标准”,2018 年更新为“弱密码标准删除通知”。

On February 8, 2018 we'll start disabling the following:

  • TLSv1/TLSv1.1: This applies to all HTTPS connections, including web, API, and git connections to https://github.comand https://api.github.com.
  • diffie-hellman-group1-sha1: This applies to all SSH connections to github.com
  • diffie-hellman-group14-sha1: This applies to all SSH connections to github.com

从 2018 年 2 月 8 日起,我们将开始禁用以下功能:

  • TLSv1/TLSv1.1:这适用于所有 HTTPS 连接,包括 web、API 和到https://github.comhttps://api.github.com 的git 连接。
  • diffie-hellman-group1-sha1:这适用于到 github.com 的所有 SSH 连接
  • diffie-hellman-group14-sha1:这适用于到 github.com 的所有 SSH 连接

So make sure your:

因此,请确保您的:

  • Git Credential Manager is greater than 1.14.0
  • Git on RedHat is (for RedHart) in 7.2 or more
  • JDK is 8 or more.
  • Git Credential Manager 大于 1.14.0
  • RedHat 上的 Git(对于 RedHart)是 7.2 或更高版本
  • JDK 为 8 或更多。

回答by Trevor Barltett

Make sure your proxy is set correctly if you have one: git config --global http.proxy http://User:PASSWORD@PROXY:PORT

如果您有代理,请确保您的代理设置正确: git config --global http.proxy http://User:PASSWORD@PROXY:PORT