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


9

我正在运行Debian(Lenny)。

当我运行这个:

curl --ssl https://www.google.com

我收到此错误:

curl: (60) SSL certificate problem: unable to get local issuer certificate
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.

该错误消息中有一个链接,告诉您去阅读一些东西,您阅读过吗?您是否已阅读该链接下的其余消息?您是否采取了这两种资源指示您采取的行动?(如果这个问题的答案最后的问题是“是”,你可能不会再被收到此错误-如果答案是诚实肯定的,你仍然遇到这个错误告诉我们哪些步骤你已经采取让它去走了,让我知道,所以我可以重新打开这个问题,我们将尽力为您提供帮助:)
voretaq7

Answers:


10

可能由于curl无法访问有效的CA证书捆绑包而发生。也许您只是没有安装这些,所以请尝试以下操作:

apt-get install ca-certificates

如果这样做没有帮助-请检查CURL_CA_BUNDLE,确保curl不会在错误的位置寻找捆扎物。


1
是的,两者都做到了。我认为是后者做到了。谢谢!
celwell 2012年

检查,CURL_CA_BUNDLE也对我有用,因此我在.profile:中有此行export CURL_CA_BUNDLE=~/.ssh/cacert.pem。也许我前段时间将其添加到调试/开发中。删除它解决了我的问题。
schmunk 2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.