ruby-changes:40603
From: hsbt <ko1@a...>
Date: Fri, 20 Nov 2015 14:40:25 +0900 (JST)
Subject: [ruby-changes:40603] hsbt:r52682 (trunk): * lib/net/http.rb: set hostname before call ossl_ssl_set_session.
hsbt 2015-11-20 14:40:04 +0900 (Fri, 20 Nov 2015) New Revision: 52682 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52682 Log: * lib/net/http.rb: set hostname before call ossl_ssl_set_session. [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek Modified files: trunk/ChangeLog trunk/lib/net/http.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 52681) +++ ChangeLog (revision 52682) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Nov 20 14:39:56 2015 SHIBATA Hiroshi <hsbt@r...> + + * lib/net/http.rb: set hostname before call ossl_ssl_set_session. + [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek + Fri Nov 20 12:53:19 2015 SHIBATA Hiroshi <hsbt@r...> * array.c: clarify docs for take_while/drop_while samples. Index: lib/net/http.rb =================================================================== --- lib/net/http.rb (revision 52681) +++ lib/net/http.rb (revision 52682) @@ -918,12 +918,12 @@ module Net #:nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L918 @socket.write(buf) HTTPResponse.read_new(@socket).value end + # Server Name Indication (SNI) RFC 3546 + s.hostname = @address if s.respond_to? :hostname= if @ssl_session and Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout s.session = @ssl_session if @ssl_session end - # Server Name Indication (SNI) RFC 3546 - s.hostname = @address if s.respond_to? :hostname= if timeout = @open_timeout while true raise Net::OpenTimeout if timeout <= 0 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/