diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-29 08:01:54 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-29 08:01:54 +0000 |
commit | 43739c725cd576cf490f4275cc403aa64f9253d3 (patch) | |
tree | e31df3a01c4913bcca44bface6162c764e202814 /lib | |
parent | ed2205ff430453569fe26cd06c6c89a0b20b1e35 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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) |