From: Chris Roos Date: 2006-10-20T17:48:10+09:00 Subject: Re: Having trouble connecting to a site via net/http On 10/20/06, jakattack2@gmail.com wrote: > Hello, > > In my app I have the need to screen scrape a HTTPS page and I'm > getting a strange error that I don't understand. I can reproduce the > error with a secure google page, which I do in the test code below. > Any help would be much appreciated. > > Janak > > #My Ruby version > ruby 1.8.4 (2005-12-24) [i386-mswin32] > > # My test code > require 'net/http.rb' > require 'uri' > > response = > Net::HTTP.get_response(URI.parse('https://www.google.com/adsense/')) > Use net/https to connect over ssl... require 'net/https' require 'uri' uri = URI.parse('https://adwords.google.com') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true # http.verify_mode = OpenSSL::SSL::VERIFY_NONE # Not setting this explicitly will result in an error and the value being set anyway response = http.get('/') p response