aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-20 05:40:04 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-20 05:40:04 +0000
commit2c97d690521f3a4d06cd0a64ef705018557abd8c (patch)
tree61fc0dfcd24c7c443226b98d308c691bc1e979e1 /lib/net
parent2fac41a63ed12a89c1f63260f135bbc7221f282f (diff)
downloadruby-2c97d690521f3a4d06cd0a64ef705018557abd8c.tar.gz
* 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/trunk@52682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-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 1021258128..d29a2d81cb 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -918,12 +918,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=
if timeout = @open_timeout
while true
raise Net::OpenTimeout if timeout <= 0