Project

General

Profile

Actions

Bug #4246

closed

Net::HTTP does not timeout during SSL connection handshake

Added by marcs (Marc Slemko) almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]
Backport:
[ruby-core:34203]

Description

=begin
If you open a SSL connection and it hangs while doing the SSL connection handshake then it does not timeout unless you end up hitting a TCP keepalive timeout.

The problem is that the open_timeout is only applied to the actual TCP socket being opened and not the SSL negotiation.

Also an issue in ruby 1.8.{6,7}.

Attached is a patch against 1.9.2. The patch also ensures that the socket gets closed if we error out in connect after it has been opened.
=end


Files

net.http.ssl.connection.timeout.patch (1.82 KB) net.http.ssl.connection.timeout.patch patch against 1.9.2 marcs (Marc Slemko), 01/07/2011 09:58 AM
net.http.ssl.connection.repro.rb (515 Bytes) net.http.ssl.connection.repro.rb a script that repros the behaviour marcs (Marc Slemko), 01/07/2011 10:00 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0