RESTClient实现:: SSLCertificateNotVerified

时间:2015-09-03 17:14:00

标签: ruby-on-rails ruby rest-client

我向网址发送帖子请求以获取访问令牌。

result = RestClient.post('https://stackexchange.com/oauth/access_token',
                        {:client_id => CLIENT_ID,
                         :client_secret => CLIENT_SECRET,
                         :code => session_code,
                         :redirect_uri => 'http://rails.example.com:3000/stackoverflow/callback'},
                         #:verify_ssl => false,
                         )

但错误如下:

RestClient::SSLCertificateNotVerified in StackoverflowController#callback
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

即使我将verify_ssl设置为false,仍然无效,希望有人可以帮助我,提前谢谢!

ruby version: ruby 2.2.2p95
rails version: Rails 4.2.3
rest-client (1.8.0)

0 个答案:

没有答案