Troubleshooting SSL Cert With Rbenv/ruby 1.9.3

Using rbenv to run ruby 1.9.3-p327 on OSX 10.8, I kept hitting this error in a rails app I was working on: Faraday::Error::ConnectionFailed (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed): This wasn’t happening under system ruby 1.8.7. I found a lot of rvm specific info, but not much on fixing for rbenv.

First (unsuccessful) solution I tried installing updated openssl (via brew) & to rebuild ruby using CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 1.9.3-p327. Again, no luck - same error.

What finally worked was downloading the cacert.pem from Install it where you want (i stuck it in /usr/local/etc/). Then, just add export SSL_CERT_FILE=/usr/local/etc/cacert.pem to your .zshrc (or .bashrc) and you will be good to go!

Hope this helps save you some time. If you’ve discovered a better way, share it in the comments!