diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-17 17:08:26 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-17 17:08:26 +0000 |
commit | fd87a8aebba9f0f7ec4afc2bf7aba5b9d623a23b (patch) | |
tree | aa7d22f797a174f6b5e599d72ad2b4af22cc0aef /lib | |
parent | e6e559c0bb196d608965e52c195773dddb302221 (diff) |
merge revision(s) r48563,r46261,r48581: [Backport #10533]
* lib/net/http.rb: Do not attempt SSL session resumption when the
session is expired. [Bug #10533]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index 954644fb00..943371df01 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -914,7 +914,10 @@ module Net #:nodoc: @socket.write(buf) HTTPResponse.read_new(@socket).value end - s.session = @ssl_session if @ssl_session + 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 } |