1
我得到這個錯誤:的OpenSSL :: SSL :: SSLError - 所以SSL_connect返回= 1個錯誤號= 0狀態= SSLv3的讀取服務器證書B:證書驗證失敗
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
行動:
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
我一直在嘗試了一些解決方案,像這樣的問題:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'MY_APPID', 'SECRET', {:scope => 'publish_stream,email', :client_options => {:ssl => {:verify => false}}}
end
和
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
其中CA-包是: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
其中cacert.pem是:http://curl.haxx.se/ca/cacert.pem
我使用Windows 7是否有人對此有解決方案或我做錯了什麼。 .pem
和.crt
之間有什麼不同?
嘿,你的問題解決了嗎?如果是,請接受正確答案。如果沒有正確的答案,請添加解決方案,以便每個人都能從中受益。 – RAJ 2015-07-16 10:43:48
問題就像3歲,不記得我是否可以使用答案。恰當地,否則我會接受它。 – 2015-07-18 19:34:52