diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-20 05:40:04 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-20 05:40:04 +0000 |
commit | 512ebc410458ff1d182c9faaa5ee325ead256e27 (patch) | |
tree | 61fc0dfcd24c7c443226b98d308c691bc1e979e1 /lib | |
parent | affbf9f35c77e5895baa8e262c4f10ab470d9b33 (diff) | |
download | ruby-512ebc410458ff1d182c9faaa5ee325ead256e27.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')
-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 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 |