[Wellington-pm] Problems with HTTPS through LWP.
michael at diaspora.gen.nz
michael at diaspora.gen.nz
Mon Jun 19 15:39:57 PDT 2006
Hi,
I've come across an interesting problem, and before filing a bug on
rt.cpan.org, I thought I'd ask the list about it.
I have the following (minimal) program, which is giving me errors:
#!/usr/bin/perl
use LWP::UserAgent;
use strict;
my $url = 'https://www.telstraclear.co.nz/usagemeter/index.cfm';
my $ua = LWP::UserAgent->new();
my $rq = HTTP::Request->new('GET');
$rq->url($url);
my $rp = $ua->request($rq);
die if $rp->code() == 500;
I'm using the Debian unstable packages of IO::Socket::SSL, and
libwww-perl.
So far I've traced this down to a call to sysread on an IO::Socket::SSL
object returning undef rather than 0 bytes (see my_read in
Net::HTTP::Methods, which calls IO::Socket::SSL::sysread, which in turn
calls Net::SSLeay::read, which is XS, and I don't know how to debug),
but I can't figure out why it's doing it.
Furthermore, sometimes lwp-request of the same URL will work!
(The 500 is definitely not authentic; it's a library problem.
wget -O- $url will always return a result.) Using a different URL
(eg https://diaspora.gen.nz/) works fine.
Can anyone shed any light on this?
-- michael
More information about the Wellington-pm
mailing list