Ruby 为 HTTPS 设置校验模式

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'net/https'
require 'net/http'

uri = URI.parse("https://www.yourDomain.gov/")


request = Net::HTTP.new(uri.host, uri.port)
request.use_ssl = true
request.ca_path = "/etc/ssl/certs/"
request.verify_mode = OpenSSL::SSL::VERIFY_PEER
response = request.get("/")