【问题标题】:Unsupported SSL protocol version不支持的 SSL 协议版本
【发布时间】:2021-11-03 03:30:34
【问题描述】:

每当我尝试使用 git clone 命令时,我的 mac 都会给我这个错误

$ git clone https://github.com/hammad1015/CN_project
Cloning into 'CN_project'...
fatal: unable to access 'https://github.com/hammad1015/CN_project/': Unsupported SSL protocol version

同样,每当我尝试使用 brew 安装某些东西时,都会发生同样的错误

brew install php
fatal: unable to access 'https://github.com/Homebrew/brew/': Unsupported SSL protocol version

卷曲

$ curl https://google.com/ --tlsv1.2 --verbose
* Hostname was NOT found in DNS cache
*   Trying 142.250.180.46...
* Connected to google.com (142.250.180.46) port 443 (#0)
* Unsupported SSL protocol version
* Closing connection 0
curl: (35) Unsupported SSL protocol version

【问题讨论】:

  • 如果你改用git clone git@github.com:hammad1015/CN_project.git 会怎样?
  • @matt 这个有效,但有什么区别?
  • Http 与 ssh。 GitHub 上不再有 http-with-password 了,这可能就是你想要做的。

标签: git ssl curl homebrew


【解决方案1】:

此消息表示您使用的 TLS(以前称为 SSL)协议版本不受支持。大多数主要网站都不再支持早于 1.2 的 TLS 版本,只接受 1.2 和可能的 1.3。

发生这种情况通常是因为您使用的是不支持 TLS 1.2 的旧版加密库。这可能是因为您的 Git 版本是针对过时版本的 OpenSSL 或 GnuTLS 编译的,或者因为它是针对 Apple Common Crypto 库编译的,但您使用的 macOS 版本不再受支持。

如果您的操作系统已过时,则应将其更新到最新版本。确保您已应用所有安全更新非常重要,尤其是在处理密码学时,因为通常会发现新的漏洞。未能运行完全修补的系统也会使您的系统受到损害,这可能导致它被用作攻击他人或传播恶意软件的基础。此外,如果您的系统确实缺乏 TLS 1.2 支持,几乎所有网站都将无法访问。

如果您的操作系统是最新的,但您只安装了一些旧版本的 Homebrew 并需要更新它,您可以在 Homebrew 存储库中运行 git remote set-url origin git@github.com:Homebrew/brew 以切换到 SSH,然后使用它执行提取。请注意,您需要使用 GitHub 设置 SSH 密钥才能使用。

请注意,如果您使用的是代理或 TLS 中间盒,则可能是它被错误配置为仅使用过时版本的 TLS,在这种情况下,您应该转移到其他网络或尝试 SSH。

【讨论】:

  • 如何设置我的 SSH 密钥?之后如何从 ssh 切换回 tls?对不起,我对这一切都很陌生
  • 你可以follow the directions on GitHub's docs site。要切换回来,请运行相同的 git remote set-url 命令,但使用 HTTPS URL 而不是 SSH URL。
猜你喜欢
  • 1970-01-01
  • 2014-08-10
  • 2016-05-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多