summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/open-uri.rb7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a51af120aa..152229cafa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Feb 19 13:52:02 2005 Tanaka Akira <akr@m17n.org>
+
+ * lib/open-uri.rb: call OpenSSL::SSL::SSLSocket#post_connection_check
+ after connection is made.
+
Sat Feb 19 01:32:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/bigdecimal/lib/bigdecimal/newton.rb: resolve LoadError.
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]