开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜