summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 12:17:15 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 12:17:15 +0000
commit041afd1cfb337d1d056defa118281728185beb97 (patch)
treea4b05d804157318190c7292d3a2f4ed3bdb25111 /lib
parent1237e7a50b1b24e069caff5e7fd53628a9444d12 (diff)
merge revision(s) 52682: [Backport #11401]
* 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_1@52799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index b841858ffd..85756445a0 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
Time.now < @ssl_session.time + @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)