diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-19 04:55:16 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-19 04:55:16 +0000 |
commit | 70a7a7271d22fefdcdf8bda832881ec9ce92569d (patch) | |
tree | 5a7398fb7c2b712430934df54f38f4024c3a3bf1 /lib | |
parent | b521ae73646fc27cb10e9e475c935fa97785abfd (diff) |
* lib/open-uri.rb: call OpenSSL::SSL::SSLSocket#post_connection_check
after connection is made.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/open-uri.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 83bb756bb1..db35a5c158 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -208,7 +208,7 @@ module OpenURI if target.userinfo && "1.9.0" <= RUBY_VERSION # don't raise for 1.8 because compatibility. - raise "userinfo not supported. [RFC3986]" + raise ArgumentError, "userinfo not supported. [RFC3986]" end require 'net/http' @@ -243,6 +243,11 @@ module OpenURI resp = nil http.start { + if http.respond_to?(:verify_mode) && + (http.verify_mode & OpenSSL::SSL::VERIFY_PEER) != 0 + # xxx: information hiding violation + http.instance_variable_get(:@socket).io.post_connection_check(target_host) + end req = Net::HTTP::Get.new(request_uri, header) if options.include? :http_basic_authentication user, pass = options[:http_basic_authentication] |