繁体   English   中英

SSL:'无法获得本地颁发者证书'

[英]SSL: 'unable to get local issuer certificate'

我正在使用OSX:10.12.4

我最初能够毫无问题地使用git,homebrew和curl。 我不记得我做了什么导致它,但突然间这些SSL错误开始出现在我的git命令中。

在运行任何git命令时,我unable to get local issuer certificate错误。 另外,我在尝试使用brew install git重新安装git时出错。

酿造产量的相关部分

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 ,然后查看证书 根据[这些说明](不能发布超过2个链接,抱歉),应该有一个“始终信任”该网站的复选框。 我没有看到这个复选框。
  • 我打算尝试使用钥匙串急救,但是,在最近的Mac OS中已删除此功能。
  • 我尝试查看许多其他类似的问题,然而,对于许多人,我无法理解或遵循答案中的说明。

例如,也许squid808对类似问题的回答可能对我有所帮助。 他说:“相反,我们应该出口并告诉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 输出 curl -L https://homebrew.bintray.com/bottles/libpng-1.6.29.sierra.bottle.tar.gz | bash -s stable 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证书。 如果应该修复此问题的标签,请告诉我。
  • 我本可以发布更多相关链接和图片,但我受到声誉的限制。

我有另一个帐户,我无法保持良好的声誉。 我试图找出并修复我以前做错的一切。 关于如何提高这个问题的质量的任何反馈都将非常感激。 谢谢。

我需要运行brew doctor并解决问题。 然后我需要重启我的shell。 最后,在这两个步骤之后,brew安装再次工作。

不幸的是,我无法确定哪个警告指向了犯罪者。 当我第一次跑brew doctor ,可能有大约10个警告。 在我意识到我需要重新启动shell之前,我清除了很多它们,并且在重新启动之后它工作了。


我想我找到了问题的根源:

Warning: Setting DYLD_* vars can break dynamic linking.
Set variables:
  DYLD_LIBRARY_PATH: /Applications/MATLAB/MATLAB_Runtime/v92/runtime/maci64:/Applications/MATLAB/MATLAB_Runtime/v92/sys/os/maci64:/Applications/MATLAB/MATLAB_Runtime/v92/bin/maci64

评论出来

set -x DYLD_LIBRARY_PATH /Applications/MATLAB/MATLAB_Runtime/v92/runtime/maci64:/Applications/MATLAB/MATLAB_Runtime/v92/sys/os/maci64:/Applications/MATLAB/MATLAB_Runtime/v92/bin/maci64

~/.config/fish/config.fish然后重新启动我的shell似乎为我解决了这个问题。


感谢@VonC参考引导我尝试brew doctor

这类似于Homebrew / brew issue 1625中报道的内容,并由Eduard Rozenberg( edrozenberg )记录

ATP播客的John Siracusa在12月7日的播客中也报道了类似的问题。

最有可能触发问题:在iCloud设置中启用iCloud Keychain

问题发生时有一个或多个可观察到的症状:

  • 弹出MacOS消息,必须修复/重置钥匙串
  • 查看Keychain Access工具时,钥匙串显示为空并设置为只读模式
  • 查看Keychain Access工具时,侧边栏上的钥匙串图标丢失(虚线边框)
  • 尝试在Google Chrome浏览器中导航至https://google.com失败,并显示SSL CERT错误运行brew搜索pip,例如,显示curl(35)证书错误消息

通过注销和重新登录和/或重新启动可以暂时解决该问题。 解决之后,Keychain Access工具将显示所有的钥匙串及其内容。 这个问题可能会在以后再次发生。

希望(手指X)Mac OS补丁(可能是10.12.2?)将解决根本原因。

否则,一个想法是禁用iCloud prefs中的iCloud Keychain选项(尚未尝试过)。

因为你在Mac Sierra 10.12.4 ...我怀疑没有补丁确实解决了这个问题。

另一个问题提到(由jamver ):

在更新到macOS Sierra(10.12)之后,我特意遇到了这个问题,解决方案来自这个传统的自制门票的解决方法:

cd ~
sudo wget http://curl.haxx.se/ca/cacert.pem
export CURL_CA_BUNDLE=~/cacert.pem

FWIW,这解决了大多数但并非所有问题。 我通过使用wget手动下载软件包并将它们放在Homebrew Cache Dir中解决了其他问题。

我有兴趣知道正确的解决方法。 例如,更新系统ca bundle? 系统捆绑需要Apple补丁吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM