开发者

SSL certificate issue with implementing facebook login via Omniauth - Windows machines

开发者 https://www.devze.com 2023-03-17 11:35 出处:网络
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:

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 ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号