[英]SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed on Mac
[英]SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed MAC
我正在嘗試使用SoundCloud SDK進行用戶身份驗證。 用戶點擊“登錄”后的第一條路線:
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
然后,我有了將它們重定向的下一條路線:
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收到以下錯誤:
/ signed_in處的OpenSSL :: SSL :: SSLError SSL_connect返回= 1 errno = 0狀態= SSLv3讀取服務器證書B:證書驗證失敗
我已閱讀以下熱門文章: http : //railsapps.github.io/openssl-certificate-verify-failed.html
SSL_connect返回= 1 errno = 0狀態= SSLv3讀取服務器證書B:證書驗證失敗
除其他外
當我輸入:
rvm osx-ssl-certs status all
我的結果是/usr/local/etc/openssl/cert.pem的證書:最新。
我目前在Mac 10.6.8上使用ruby 2.1.1。 我已經解決了有關該主題的約20個堆棧溢出問題,並且無法解決這個問題。
/usr/local/etc/openssl/certs/
使omniauth.rb看起來像這樣:
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
有一個gem可以解決此問題,請嘗試將Gemfile
gem 'certified', '~> 1.0'
到您的Gemfile
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.