尝试使用以下命令访问 github 失败,并出现验证失败错误。我应该怎么做才能解决这个问题
C:\software\curl-7.23.1-win64-ssl-sspi>curl -i https://api.github.com
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://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.
使用 msysgit,我有时必须再次指定http.sslcainfo
让 msysgit 正确获取正确的 CA 证书文件。
git config --system http.sslcainfo \bin/curl-ca-bundle.crt
(Also 在此介绍 http://www.vogella.de/blog/2010/08/09/git-https/并在commentsGitHub 智能 http 页面的 https://github.com/blog/642-smart-http-support)
如果这不起作用:
- 尝试指定完整路径:
git config --system http.sslcainfo /c/path/to/msysgit/bin/curl-ca-bundle.crt
,如图所示博客文章 http://lostechies.com/keithdahlby/2010/09/26/msysgit-error-setting-certificate-verify-locations/:
一个更简单的修复方法就是设置http.sslcainfo
的绝对路径curl-ca-bundle.crt
文件位于 msysGit 安装的 bin 文件夹中:
$ git config --global http.sslcainfo "/c/Program Files (x86)/Git/bin/curl-ca-bundle.crt"
我选择在--global
级别,以便将来的 msysGit 安装不会覆盖该设置。
- 其他替代方案详见“HTTPS github 访问 https://stackoverflow.com/questions/3777075/https-github-access"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)