From 43739c725cd576cf490f4275cc403aa64f9253d3 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 29 Nov 2015 08:01:54 +0000 Subject: merge revision(s) 52682: [Backport #11401] [Backport #11724] * lib/net/http.rb: set hostname before call ossl_ssl_set_session. [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/http.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/http.rb b/lib/net/http.rb index ee4f28d6b6..58f1095d20 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -914,12 +914,12 @@ module Net #:nodoc: @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= Timeout.timeout(@open_timeout, Net::OpenTimeout) { s.connect } if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE s.post_connection_check(@address) -- cgit v1.2.3