I’ve run into this issue twice and now I’m writing down the solution. When authenticating with Facebook via Omniauth, my server always fails with the following error:

1
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):

This is easily fixed by adding the following to one of the initializers:

1
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

It’s probably not the best solution, as this turns off SSL peer verification..

A better solution:

http://stackoverflow.com/questions/5711190/how-to-get-rid-of-opensslsslsslerror