[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

curl и самоподписанные сертификаты



есть чужой сайт с самоподписанным сертификатом, скажем https://billing.ptcomm.ru

curl на него ругается (что и ожидалось):
edo@work:/tmp$ curl https://billing.ptcomm.ru
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). The default
 bundle is named curl-ca-bundle.crt; 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://curl.haxx.se/docs/sslcerts.html
по написанным там иструкциям получаю сертификат того сайта, предлагаю его curl'у в качестве cacert - ничего не меняется:
edo@work:/tmp$ curl --cacert ptcomm.pem https://billing.ptcomm.ru
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
....

у меня есть подозрение, что дело в том, что это не корневой сертификат:
edo@work:/tmp$ openssl x509 -inform PEM -in ptcomm.pem -text|grep 'CA:'
                CA:FALSE

как побороть? (про '-k' знаю, неинтересно)


ps: меня смущает, что с --cacert остальные сайты работают, например:
edo@work:/tmp$ curl --cacert ptcomm.pem https://gmail.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://mail.google.com/mail/";>here</A>.
</BODY></HTML>

я думал указывая нужный мне корневой сертификат я говорю curl'у не доверять больше никому.


Reply to: