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

后端 未结 3 1442
不思量自难忘°
不思量自难忘° 2021-01-23 00:46

I tried to put verify_ssl=>false to the request, but it doesn\'t work.

Below is my code:

def login_request (username, password)
  reques         


        
相关标签:
3条回答
  • 2021-01-23 01:19

    Try this:

    def login_request (username, password)
      request = {'userName': username, 'password': password}.to_json
      url = "#{$url_host}#{$login_api}"
      begin
        res = RestClient.post(
            url,
            request,
            :content_type => :json, :accept => :json,
            :verify_ssl => false)
        response_data = JSON.parse(res.body) 
        $user_token = response_data['token'] 
        $userId = response_data['user']['userId'] 
        p response_data['user']['email'] 
      rescue Exception => e
      end
    end
    

    You can put the authentication details with :varify_ssl.

    0 讨论(0)
  • 2021-01-23 01:23

    please use RestClient::Request.execute(method: :get, url: url, headers: headers, verify_ssl: false)

    verify_ssl is not accepted in RestCient.method

    0 讨论(0)
  • 2021-01-23 01:41

    We're facing the same exact error (B: certificate verify failed) and it's driving me nuts. This started showing up for our developers around the 10th of Oct, 2015.

    In authorize.net developer forums there are many threads with the same issue, two of which are recent (first thread) (second thread) and both went dead with no resolution, these two threads started around the same time we started facing this issue, so my guess is that it has to do with authorize.net bad/new certificate with missing certificate chain.

    This exact issue appeared before around 2012 and 2014 (check their developer forum), Authorize.net admitted it was a bad change they made to their certificates and then later fixed the issue, but this time it appears to be an ongoing since mid October.

    PS: I tried installing every root/chain certificate on our server but this issue persists.

    0 讨论(0)
提交回复
热议问题