Cent os 5.6でcurlしようとしたら怒られた。 | iii threetreeslight

September 26, 2013

Cent os 5.6でcurlしようとしたら怒られた。

vagrantで古いboxを立ち上げて、chefでcookingしようとしたら怒られた。

初体験。

原因

サーバーのSSL CA証明書が古いのが原因

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

solution

既存の鍵移動

$ cd /etc/pki/tls/certs/
$ sudo mv ca-bundle.crt ca-bundle.crt.org

新しい証明書

$ sudo wget http://curl.haxx.se/ca/cacert.pem
$ sudo mv ./cacert.pem ./ca-bundle.crt

参考:サーバのSSL CA(認証局)証明書が古くてcurl がエラーになる件