3

I am facing the same issue as described here - OmniAuth & Facebook: certificate verify failed

The most voted answer suggests adding the following to your Omniauth initializer:

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook, FACEBOOK_KEY, FACEBOOK_SECRET, {:client_options => {:ssl => {:ca_path => "/etc/ssl/certs"}}}
end

However he mentions "/etc/ssl/certs" is the CA_PATH for ubuntu. What is the relevant CA_PATH for an windows ?

If there is no certificate on my machine , how do I install one and where do I put the certificate file ?

Community
  • 1
  • 1
geeky_monster
  • 8,672
  • 18
  • 55
  • 86

1 Answers1

13

This is how I solved the issue -

I downloaded this file - http://certifie.com/ca-bundle/ca-bundle.crt.txt and put in my app/config folder.

I renamed the file as ca-bundle.crt

I updated my omniauth initializer to relfect the following -

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook, FACEBOOK_KEY, FACEBOOK_SECRET, :client_options => { :ssl => { :ca_file => "#{Rails.root}/config/ca-bundle.crt" } } 
end

And it worked.

geeky_monster
  • 8,672
  • 18
  • 55
  • 86
  • do you know if this still working. Im getting this issue but this fix is not working for me – Steve May 06 '13 at 18:37
  • It works ! Thanks for the solution. I found another solution but that didn't work yet there are lots of people who gave a vote to that answer. – BC2 Nov 19 '13 at 22:25
  • I got the following message in my dev env (localhost Windows) "Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains." Any ideas? – MatheusJardimB Apr 14 '14 at 02:18
  • The message above came because I was using 'localhost' and registered '127.0.0.1' at Facebook. Now I'm getting the original error again – MatheusJardimB Apr 14 '14 at 02:21