LWP::UserAgent hangs on SSL connections with keep-alive enabled

Bug #1161640 reported by Michael Spratte
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libnet-http-perl (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When using LWP::UserAgent on SSL connections with keep-alive enabled the connection will hang or terminate with an error. This bug was introduced between 10.04 and 12.04.

The attached program ssl-keep-alive.pl run on 12.04 demonstrates the problem. An example run with keep-alive disabled produces the following output (where the first argument is the URL and the second is 0 to disable keep-alive or 1 to enable it):

$ ./ssl-keep-alive.pl https://bugs.launchpad.net/ubuntu/+source/libnet-http-perl/+bug/1057609 0
starting GET ... done (elapsed time so far: 2 seconds)
starting GET ... done (elapsed time so far: 4 seconds)
starting GET ... done (elapsed time so far: 5 seconds)
starting GET ... done (elapsed time so far: 6 seconds)
starting GET ... done (elapsed time so far: 8 seconds)
$

Enabling keep-alive produces differing output:

$ ./ssl-keep-alive.pl https://bugs.launchpad.net/ubuntu/+source/libnet-http-perl/+bug/1057609 1
starting GET ... done (elapsed time so far: 2 seconds)
starting GET ... done (elapsed time so far: 2 seconds)
starting GET ... done (elapsed time so far: 3 seconds)
starting GET ... done (elapsed time so far: 3 seconds)
starting GET ... done (elapsed time so far: 3 seconds)
$ ./ssl-keep-alive.pl https://bugs.launchpad.net/ubuntu/+source/libnet-http-perl/+bug/1057609 1
starting GET ... done (elapsed time so far: 17 seconds)
starting GET ...
500 Server closed connection without sending any data back
$

Using the latest Net::HTTP::Method module (version 6.06) fixes the problem. See https://rt.cpan.org/Public/Bug/Display.html?id=81237 for details of this bug. Upgrading package libnet-http-perl to the latest upstream version 6.06 not only will fix this problem but also address bug 1057609 (https://bugs.launchpad.net/ubuntu/+source/libnet-http-perl/+bug/1057609).

Revision history for this message
Michael Spratte (michael-spratte) wrote :
Revision history for this message
Florian Schlichting (fschlich) wrote :

The fix has landed in Ubuntu, thus closing this bug now

Changed in libnet-http-perl (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.