I'm building a Rails 3 app using Devise/OmniAuth, and Koala and I'm getting the following SSL error:
OpenSSL::SSL::SSLError in Users/omniauth callbacksController#facebook
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
The code that causes this error is:
@graph = Koala::Facebook::GraphAPI.new(@token)
@friends = @graph.get_connections("me", "friends")
I am using Devise with OmniAuth to perform authentication, which works. I then take the returned facebook token, and attempt to use it with Koala as shown above. That is what causes this error.
It's probably worth noting that I was receiving the same error with Devise & OmniAuth initially. There are a few topics about this error, and I was able to solve it, by setting up my config/initialisers/devise.rb with,
config.omniauth :facebook, APPID, APPKEY, {:client_options => {:ssl => {:ca_file => "/opt/local/share/curl/curl-ca-bundle.crt"}}}
I am guessing that I need to supply a similar configuration for Koala so that it knows where to retrieve the local ca_file. I can't find any indication of how to do so in the documentation though. Any ideas on how to do this, or how to avoid the error in general?
My dev environment is OSX.