Skip to content

Instantly share code, notes, and snippets.

@n8agrin
Created June 13, 2009 15:48
Show Gist options
  • Save n8agrin/129296 to your computer and use it in GitHub Desktop.
Save n8agrin/129296 to your computer and use it in GitHub Desktop.
require 'net/https'
require 'uri'
SITE_URI = ''
SITE_CA = ''
USERNAME = ''
PASSWORD = ''
uri = URI.parse(SITE_URI)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.ca_file = SITE_CA
req = Net::HTTP::Get.new(uri.path)
req.basic_auth(USERNAME, PASSWORD)
res = http.request(req)
p res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment