summaryrefslogtreecommitdiffstats
path: root/lib/open-uri.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-01 03:49:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-01 03:49:12 +0000
commita4d4bf80162004c82a7df0960d7787e80bb238d9 (patch)
treeac5da15d747a19ef93b5d0a6285c7526228638e0 /lib/open-uri.rb
parent7e54771e7121268191008f9e41e8730e0ace164c (diff)
downloadruby-a4d4bf80162004c82a7df0960d7787e80bb238d9.tar.gz
ruby-a4d4bf80162004c82a7df0960d7787e80bb238d9.tar.xz
ruby-a4d4bf80162004c82a7df0960d7787e80bb238d9.zip
* lib/open-uri.rb (OpenURI.open_http): refine post_connection_check
call. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r--lib/open-uri.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index ce96e5b1c..a5459c25c 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -243,10 +243,15 @@ module OpenURI
resp = nil
http.start {
- if http.respond_to?(:verify_mode) &&
- (http.verify_mode & OpenSSL::SSL::VERIFY_PEER) != 0
+ if target.class == URI::HTTPS
# xxx: information hiding violation
- http.instance_variable_get(:@socket).io.post_connection_check(target_host)
+ sock = http.instance_variable_get(:@socket)
+ if sock.respond_to?(:io)
+ sock = sock.io # 1.9
+ else
+ sock = sock.instance_variable_get(:@socket) # 1.8
+ end
+ sock.post_connection_check(target_host)
end
req = Net::HTTP::Get.new(request_uri, header)
if options.include? :http_basic_authentication