Faraday::Error::ConnectionFailed solved with RVM

Recently I’ve discovered that recent versions of RVM have a utility to diagnose and resolve errors caused by outdated certificate files.

If you ever get an error like that:

openssl::ssl::sslerror: ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed

Here are the commands you need:

$ rvm osx-ssl-certs status all
Certificates for /opt/sm/pkg/versions/openssl/1.0.1e/ssl/cert.pem: Old.
Certificates for /usr/local/etc/openssl/cert.pem: Old.
$ rvm osx-ssl-certs update all
Updating certificates for /opt/sm/pkg/versions/openssl/1.0.1e/ssl/cert.pem: Updating certificates in '/opt/sm/pkg/versions/openssl/1.0.1e/ssl/cert.pem'.
Updated.
Updating certificates for /usr/local/etc/openssl/cert.pem: Updating certificates in '/usr/local/etc/openssl/cert.pem'.
Updated.

The first command should show everything up to date:

$ rvm osx-ssl-certs status all
Certificates for /opt/sm/pkg/versions/openssl/1.0.1e/ssl/cert.pem: Up to date.
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.

If you still have problems, check this article: http://railsapps.github.io/openssl-certificate-verify-failed.html

Leave a Reply

wpDiscuz