diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-07 13:37:43 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-07 13:37:43 +0000 |
commit | afe7aac47b11693090f552df05f894d2ced8ada3 (patch) | |
tree | 817ca50ea437a57c92d48d2db1f01fa1fd303d64 /lib/net/http.rb | |
parent | 60f2c9cf5bea6dd99fac50c460eab4809cc30b01 (diff) | |
download | ruby-afe7aac47b11693090f552df05f894d2ced8ada3.tar.gz |
* lib/net/http.rb (Net::HTTP#connect): support SNI (Server Name
Indication) for HTTPS. [ruby-dev:43164]
http://stackoverflow.com/questions/4685736/openssl-server-name-indication-support-in-ruby
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r-- | lib/net/http.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index c90b20297c..a2891495d5 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -780,6 +780,8 @@ module Net #:nodoc: @socket.writeline '' HTTPResponse.read_new(@socket).value end + # Server Name Indication (SNI) RFC 3546 + s.hostname = @address if s.respond_to? :hostname= timeout(@open_timeout) { s.connect } if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE s.post_connection_check(@address) |