How to connect to an https server with an invalid certificate using the latest versions of Ruby How to connect to an https server with an invalid certificate using the latest versions of Ruby ruby ruby

How to connect to an https server with an invalid certificate using the latest versions of Ruby


uri = URI("https://host/index.html")req = Net::HTTP::Get.new(uri.path)res = Net::HTTP.start(        uri.host, uri.port,         :use_ssl => uri.scheme == 'https',         :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|  https.request(req)end


require 'nokogiri'require 'open-uri'require 'net/https'@doc = Nokogiri::HTML(open(my_url,  :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE))