阅读背景:

如何使用最新版本的Ruby连接到具有无效证书的https服务器

来源:互联网 

Consider the following code:

请考虑以下代码:

require 'net/https'
uri = URI.parse("https://host/index.html")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.path)
response = http.request(request)
requi



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: