[英]OpenSSL::SSL::SSLError - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
I get this error: 我收到此错误:
OpenSSL::SSL::SSLError
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'MY_APPID', 'SECRET', {:scope => 'publish_stream,email', :client_options => {:ssl => {:ca_path => "#{Rails.root}/config/cacert.pem"}}}
end
The action: 那个行动:
def callback
session['fb_auth'] = request.env['omniauth.auth']
session['fb_token'] = session['fb_auth']['credentials']['token']
session['fb_error'] = nil
render :text => request.env['omniauth.auth'].to_yaml
end
I have been trying some solutions to this problem like: 我一直在尝试一些解决此问题的方法,例如:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'MY_APPID', 'SECRET', {:scope => 'publish_stream,email', :client_options => {:ssl => {:verify => false}}}
end
and 和
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'MY_APPID', 'SECRET', {:scope => 'publish_stream,email', :client_options => {:ssl => {:ca_path => "#{Rails.root}/config/ca-bundle.crt"}}}
end
Where ca-bundle is: http://certifie.com/ca-bundle/ca-bundle.crt.txt 其中ca-bundle是: http : //certifie.com/ca-bundle/ca-bundle.crt.txt
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'MY_APPID', 'SECRET', {:scope => 'publish_stream,email', :client_options => {:ssl => {:ca_path => "#{Rails.root}/config/cacert.pem"}}}
end
Where cacert.pem is: http://curl.haxx.se/ca/cacert.pem 其中cacert.pem是: http ://curl.haxx.se/ca/cacert.pem
I am using Windows 7. Does anybody have a solution on this or I am doing something wrong. 我正在使用Windows7。是否有人对此有解决方案,或者我做错了什么。 What is the differens between .pem
and .crt
? .pem
和.crt
什么区别?
Ruby cannot find any root certificates. Ruby无法找到任何根证书。
Here is another option for debugging purposes: 这是用于调试目的的另一个选项:
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
Source: https://stackoverflow.com/a/12032944/1047207 (My answer to similar question) 来源: https : //stackoverflow.com/a/12032944/1047207 (我对类似问题的回答)
You may want to take a look at this Blog also. 您可能还想看看这个博客 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.