【发布时间】:2017-08-31 19:52:50
【问题描述】:
我正在使用 OSX:10.12.4
我最初能够毫无问题地使用 git、homebrew 和 curl。我不记得我做了什么导致它,但突然这些 SSL 错误开始出现在我的 git 命令中。
我在运行任何 git 命令时收到 unable to get local issuer certificate 错误。此外,我在尝试使用brew install git 重新安装 git 时遇到错误。
brew 输出的相关部分:
Downloading https://www.kernel.org/pub/software/scm/git/git-2.12.2.tar.xz
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
我试过了:
- 正在重新启动
- 将 ~/Library/Keychains 文件夹移动到 ~/Desktop,然后重新启动
- 在 safari 上导航到 https://www.kernel.org/pub/software/scm/git,以及 viewing the certificate。根据[这些说明](不能发布超过 2 个链接,抱歉),应该有一个“始终信任”该站点的复选框。我没有看到这个复选框。
- 我本来打算试试钥匙串急救,但最近的 Mac OS 中删除了此功能。
- 我尝试查看许多其他类似的问题,但是,对于许多问题,我无法理解或遵循答案中的说明。
例如,也许 squid808 的 answer 对一个类似的问题可以帮助我。他说:“相反,我应该导出并告诉 Git 信任的是我们域中的根 CA 证书。”我不太了解这意味着什么,或者它是否与我相关,或者我将如何去做。根据我的研究,这似乎更适合运行服务器的人。它似乎也适用于 Windows,我在 Mac 上。
我了解,作为 临时 修复,除了 curl 中的 -k 选项外,我还可以使用 git config --global http.sslVerify false。这些变通办法是不安全的,所以我想尽快恢复我的 SSL 安全性并运行。
输出 curl -L https://homebrew.bintray.com/bottles/libpng-1.6.29.sierra.bottle.tar.gz | bash -s stable(同样失败的 brew 尝试的一部分)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
道歉
- 如果我为解决此问题所做的以下尝试看起来分散且杂乱无章,那是因为我很困惑这是一个与 git、curl 或可能两者都不是更相关的问题,而只是一般的 SSL 证书。请让我知道是否应该修复此问题的标签。
- 我本可以发布更多相关链接和图片,但我受到声誉的限制。
我有另一个帐户,我无法在该帐户上保持良好的声誉。我正在尝试识别并修复我之前做错的所有事情。任何有关如何提高此问题质量的反馈都将不胜感激。谢谢。
【问题讨论】:
-
\curl -L <url> | bash -s stable的输出是什么 -
@CodeWizard 查看我更新的问题。
标签: git macos ssl curl ssl-certificate