LWP::UserAgent hangs on SSL connections with keep-alive enabled
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:/
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:/
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:/
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:/
The fix has landed in Ubuntu, thus closing this bug now