verify_mode = OpenSSL::SSL::VERIFY_PEER : HTTPS « Network « Ruby






verify_mode = OpenSSL::SSL::VERIFY_PEER


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("/")

 








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.Set verify mode for https