root@Tek-life:/home/xx/bin# curl https://www.google.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.
摸索了一天也没搞出个所以然来。
有人遇到同样的问题么?
也可以用
openssl s_client -connect www.google.com:443
查看Server certificate,把它拷贝到一个文件。然后curl运行的时候设置--cacert为这
个文件。
--
$ openssl s_client -connect www.google.com:443
connect: Connection timed out
connect:errno=110
Start Time: 1321577321
Timeout : 300 (sec)
Verify return code: 20 (unable to get local issuer certificate)
---
把Server certificate拷贝到ca.crt。然后:
$ curl https://www.google.com --cacert ca.crt
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.
问题依旧啊。
> > 或者请看这篇文档
> > http://wiki.qnap.com/wiki/Setup_Fetchmail_For_GMail_To_XDove
> > 的Install Certificates。
--
临江仙·滚滚长江东逝水--杨慎
滚滚长江东逝水,浪花淘尽英雄。
是非成败转头空。青山依旧在,几度夕阳红。
白发渔樵江渚上,惯看秋月春风。
一壶浊酒喜相逢。古今多少事,都付笑谈中。
--
Li Haifeng
Laboratory of Service Computing Technology and System
Home page:http://tek-life.org
你打开Firefox在地址栏输入https://www.google.com. 然后在地址栏最前面的按
钮打开的对话框里面把证书导出来,然后用这个证书去curl。
之前证书的证书不同,是因为我用了Wallproxy。
这里我给你贴一个。
用curl同样也会被定向到http://...hk.
如果你无法直接连接,可以在hosts文件里面把www.google.com对应到
74.125.235.17。
这里是我的运行结果。
# curl --cacert ./www.google.com.pem https://www.google.com
<HTML><HEAD><meta http-equiv="content-type"
content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A
HREF="http://www.google.com.hk/url?sa=p&hl=zh-CN&pref=hkredirect&pval=yes&q=http://www.google.com.hk/&ust=1321593933060945&usg=AFQjCNF2ngM8pbxQdhBMubosFBFSeVfNPw">here</A>.
</BODY></HTML>
在你的机器上不行,现在有两个怀疑的地方,你的VPN,还有curl的版本。
你可以先把VPN关掉。把上面那个IP加到hosts里面试试。
还有我的curl版本是,(你的没有TLS,不知道这个会不会影响)
# curl --version
curl 7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 GnuTLS/2.10.5
zlib/1.2.5.1 libidn/1.22 libssh2/1.3.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps
pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL
libz TLS-SRP
最后想说一下,如果你只是想连google,为什么不用-k选项忽略掉证书的检查。
--
Best Regards,
du yang
用curl是下载repo的,用repo来 clone android_platform
但是一直报错。不知道错误原因,所以就在瞎捣鼓。