尝试通过rest-client调用第三方api,给出RestClient :: SSLCertificateNotVerified错误

时间:2017-08-02 09:37:14

标签: ruby-on-rails rest-client

我试着打电话给https://example.com的休息api,但是上面的错误请帮助我同样的

1 个答案:

答案 0 :(得分:0)

要绕过验证SSL证书,您可以使用:verify_ssl =>像这样假的

RestClient::Request.execute(:url => 'https://example.com/', :method => :get, :verify_ssl => false)

如果不起作用也将:proxy => nil像这样

RestClient::Request.execute(:url => 'https://example.com/', :method => :get, :verify_ssl => false, :proxy => nil)