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 | 72cbe4c2bc8b0f2d75c761fac9d5e96c9ac03f23 (patch) | |
tree | fbef430d0f25cded0b9dbf0bdbc4dc60e2fd10ca /lib/open-uri.rb | |
parent | ea11501f7e3a0527e18707edd9f4b72487290879 (diff) | |
download | ruby-72cbe4c2bc8b0f2d75c761fac9d5e96c9ac03f23.tar.gz ruby-72cbe4c2bc8b0f2d75c761fac9d5e96c9ac03f23.tar.xz ruby-72cbe4c2bc8b0f2d75c761fac9d5e96c9ac03f23.zip |
* lib/open-uri.rb: call OpenSSL::SSL::SSLSocket#post_connection_check
after connection is made.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open-uri.rb')
-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 83bb756bb..db35a5c15 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] |