Set verify mode for https : HTTPS « Network « Ruby






Set verify mode for https


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.verify_mode = OpenSSL::SSL::VERIFY_NONE
response = request.get("/")

response.body.size                             # => 6537

 








Related examples in the same category

1.Secure HTTP with HTTPS
2.Get a secure way of sending sensitive information to the remote server:
3.Making an HTTPS Web Request
4.verify_mode = OpenSSL::SSL::VERIFY_PEER