search
LoginSignup
12

More than 5 years have passed since last update.

posted at

Rubyのopensslの証明書が見つからない時ってどうすればいいの?

Faraday::Error::ConnectionFailed: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

1.証明書の置き場所を調べる

homebrew経由か、MacPortsかで変わる

$ ruby -ropenssl -e 'p OpenSSL::X509::DEFAULT_CERT_FILE'
"/usr/local/etc/openssl/cert.pem"

2.証明書をダウンロードして指定の場所に置く。

$ curl -O http://curl.haxx.se/ca/cacert.pem
$ mv cacert.pem /usr/local/etc/openssl/cert.pem

homebrewを使っているなら以下のやりかたの方がいいかも。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
12