SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败的MAC [英] SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed MAC
问题描述
我正在尝试使用SoundCloud SDK进行用户身份验证.用户点击登录"后的第一条路线:
I'm attempting to use the SoundCloud SDK for user authentication. My first route after a user clicks "sign in":
get "/login" do
client = Soundcloud.new(:client_id => 'MY_ID',
:client_secret => 'MY_SECRET',
:redirect_uri => 'http://localhost:9393/signed_in')
redirect client.authorize_url()
end
然后我将重定向到下一条路线:
I then have the next route where they are redirected:
get "/signed_in" do
client = Soundcloud.new(:client_id => '16d6ada1a0cfc5009f7d59d203a13b2f',
:client_secret => '845df7d44dc4e359fedc8ed5944d29a5',
:redirect_uri => 'http://localhost:9393/signed_in')
code = params[:code]
access_token = client.exchange_token(:code => code)
end
我可以成功命中重定向URL,并且代码被传回,但是我从Sinatra收到以下错误:
I can succesfully hit the redirect url and a code is passed back, but I receieve the following error from Sinatra:
/signed_in处的OpenSSL :: SSL :: SSLError SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败
OpenSSL::SSL::SSLError at /signed_in SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
我已阅读以下热门文章: http://railsapps.github.io/openssl-certificate-verify-failed. html
I've read these popular articles: http://railsapps.github.io/openssl-certificate-verify-failed.html
SSL_connect返回= 1 errno = 0 state = SSLv3读取服务器证书B:证书验证失败
还有许多其他
当我键入:
rvm osx-ssl-certs status all
我的结果是 /usr/local/etc/openssl/cert.pem的证书:最新.
my result is Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
我目前在Mac 10.6.8上使用ruby 2.1.1.我已经解决了有关该主题的大约20个堆栈溢出问题,并且无法解决这个问题.
I'm currently using ruby 2.1.1 on Mac 10.6.8. I've gone thru about 20 stack overflow questions on this topic and I'm unable to move past this issue.
推荐答案
- 下载 http://curl.haxx.se/ca/ca-bundle.crt
- 将证书复制到
/usr/local/etc/openssl/certs/
-
使omniauth.rb看起来像这样:
- Download http://curl.haxx.se/ca/ca-bundle.crt
- Copy certificate into
/usr/local/etc/openssl/certs/
Make omniauth.rb look like this:
options = {
scope: "email",
:prompt => "select_account",
access_type: 'offline',
:client_options => {
:ssl => {
:ca_file => "/usr/local/etc/openssl/certs/ca-bundle.crt",
:ca_path => "/usr/local/etc/openssl/certs"
}
}
}
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, Rails.application.secrets.client_id, Rails.application.secrets.client_secret, options
end
这篇关于SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败的MAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!