OpenSSL :: SSL :: SSLError(SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败):

时间:2014-08-25 09:22:17

标签: ruby-on-rails ssl

我设置了一个json方法来解析返回的数据,但我一直收到错误 OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):

def get_json(url)
      encoded_url = URI.encode(url)
      uri = URI(encoded_url)
      result = Net::HTTP.get(uri) # => String
      @json = Crack::XML.parse(result).deep_symbolize_keys
    end

我还要求以下内容:

require 'open-uri'
require 'net/https'
require 'crack' # for xml and json
require 'crack/json' # for just json
require 'crack/xml' # for just xml

0 个答案:

没有答案