summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 07:09:48 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 07:09:48 +0000
commit711ece42cddc4737a4b1667b1f20ca74030d0255 (patch)
treea94e58d7ebb887aa4351d0bab07488200d72ce5a /lib
parent49cb41192aee7bc137db4357e4d7e3903195c1b2 (diff)
* 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/trunk@48563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index aceb530442..b5706c597f 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 }