diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-01 03:49:12 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-01 03:49:12 +0000 |
commit | f99971051f31ebc463e005fa8be9d0b0a24a449d (patch) | |
tree | ac5da15d747a19ef93b5d0a6285c7526228638e0 | |
parent | 626f1ee196fe06514d66771ff0e3f82d7686af25 (diff) | |
download | ruby-f99971051f31ebc463e005fa8be9d0b0a24a449d.tar.gz |
* lib/open-uri.rb (OpenURI.open_http): refine post_connection_check
call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/open-uri.rb | 11 |
2 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Fri Jul 1 12:44:56 2005 Tanaka Akira <akr@m17n.org> + + * lib/open-uri.rb (OpenURI.open_http): refine post_connection_check + call. + Fri Jul 1 11:34:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org> * missing/crypt.c: replaced with 4.4BSD version. diff --git a/lib/open-uri.rb b/lib/open-uri.rb index ce96e5b1c9..a5459c25c0 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 |