From 708d76a3b1ab9d5b888a9e68773406e289860aa0 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 26 Nov 2011 11:44:45 +0000 Subject: [PATCH] * lib/net/http.rb (Net::HTTP.get_response): enable use_ssl if given URI object is https. patched by Mark Ferlatte [ruby-core:40665] [Bug #5545] * lib/net/http.rb (Net::HTTP.post_form): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ lib/net/http.rb | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index de7fcd93c6..19a09d0c25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Nov 26 20:41:48 2011 NARUSE, Yui + + * lib/net/http.rb (Net::HTTP.get_response): enable use_ssl + if given URI object is https. + patched by Mark Ferlatte [ruby-core:40665] [Bug #5545] + + * lib/net/http.rb (Net::HTTP.post_form): ditto. + Sat Nov 26 20:01:18 2011 NARUSE, Yui * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): refix 33701. diff --git a/lib/net/http.rb b/lib/net/http.rb index 2fd81e0d2c..c383f206d3 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -451,7 +451,8 @@ module Net #:nodoc: } else uri = uri_or_host - new(uri.hostname, uri.port).start {|http| + start(uri.hostname, uri.port, + :use_ssl => uri.scheme == 'https') {|http| return http.request_get(uri.request_uri, &block) } end @@ -479,7 +480,8 @@ module Net #:nodoc: req = Post.new(url.request_uri) req.form_data = params req.basic_auth url.user, url.password if url.user - new(url.hostname, url.port).start {|http| + start(url.hostname, url.port, + :use_ssl => uri.scheme == 'https' ) {|http| http.request(req) } end