Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Omniauth Facebook Error - Faraday::Error::ConnectionFailed

(FYI: I'm following the Twitter Omniauth from railscast #241. I used Twitter successfully, now going onto Facebook)

As soon as I logged into Facebook using Omniauth, I get this error:

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

What does this mean?

This is my code

Rails.application.config.middleware.use OmniAuth::Builder do   provider :facebook, '<key from fb>', '<another key from fb>' end 

There's actually nothing much in my code, all I have is in the sessionController that I want to use to_yaml to see what's inside the request.env

class SessionsController < ApplicationController     def create         raise request.env["omniauth.auth"].to_yaml     end end 

How do I solve the Faraday error?

like image 319
user1372829 Avatar asked May 27 '12 16:05

user1372829


1 Answers

I've fixed this on Mac OS X Lion 10.7.4 with this solution:

$ rvm remove 1.9.3 (or whatever version of ruby you are using) $ rvm pkg install openssl $ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr 

after this you will need to download the missing cacert.pem file:

$ cd $rvm_path/usr/ssl $ sudo curl -O http://curl.haxx.se/ca/cacert.pem $ sudo mv cacert.pem cert.pem 
like image 167
Andrei Radulescu Avatar answered Sep 18 '22 11:09

Andrei Radulescu