diff --git a/ChangeLog b/ChangeLog index fedacf12c3..6b491d7290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Feb 7 22:34:20 2011 Tanaka Akira + + * 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 + Mon Feb 7 16:05:32 2011 Eric Hodel * lib/rdoc: Upgrade to RDoc 3.5.3 Fixes [Bug #4376] diff --git a/NEWS b/NEWS index 7d206779f5..d4311a7c57 100644 --- a/NEWS +++ b/NEWS @@ -88,6 +88,9 @@ with all sufficient information, see the ChangeLog file. * IO#winsize * IO.console +* net/http + * SNI (Server Name Indication) supported for HTTPS. + * optparse * support for bash/zsh completion. 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)