Project

General

Profile

Bug #4550 ยป t.rb

test file illustrating bug. - drbrain (Eric Hodel), 04/04/2011 05:20 AM

 
1
require 'openssl'
2
require 'net/http'
3

    
4
key = OpenSSL::PKey::RSA.new 512
5
pem  = key.public_key.to_pem
6

    
7
uri = URI.parse 'https://www.gmail.com'
8
http = Net::HTTP.new uri.hostname, uri.port
9
http.set_debug_output $stderr
10
http.use_ssl = true
11
http.start do
12
  req = Net::HTTP::Get.new uri.request_uri
13

    
14
  http.request req
15

    
16
  OpenSSL::PKey::RSA.new pem
17

    
18
  http.request req
19
end
20