|
|
Hi,
I have set the timeout for LWP to 10 seconds. It works fine for HTTP
connections, I get a 500 Timeout error. But for HTTPS (SSL) connections
the client just hangs without any timeout if the server does not respond.
I have the same problem with the ActiveState perl as well as the version
of Perl provided by Randy Kobes at http://theoryx5.uwinnipeg.ca/
Maybe we should move to a pure Perl implementation of SSL. Pure Perl
implementations of most Crypt algorithms already exist. I feel we should
get rid of this dependency on openssl which refuses to provide a usable
windows port.
OS: WinXP Pro.
Tested on ActivePerl version 5.8.3.809. LWP version 5.75. Crypt-SSLeay
version 0.51.
and
theoryx5 Perl 5.8.4.810 LWP version 5.51. Crypt-SSLeay version 0.51.
Below is the sample code for the client:
=====================================
use LWP::UserAgent;
use Crypt::SSLeay;
my $req = HTTP::Request->new(GET => 'https://localhost:8000');
my $ua =LWP::UserAgent->new;
$ua->timeout(10);
my $response = $ua->request($req);
print $response->as_string;
=====================================
The sample code for the server (in case you need one to test against):
=====================================
use IO::Socket;
my $socket = IO::Socket::INET->new(Listen => 5,
LocalAddr => 'localhost',
LocalPort => 8000,
Proto => 'tcp');
my $accept = $socket->accept;
while(1)
{
sleep(10);
}
=======================================
Regards,
Emmanuel
http://emmanuel_e.tripod.com/contact_me.htm
_______________________________________________
ActivePerl mailing list
ActivePerl@xxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
|