CC: | hv [...] crypt.org |
Subject: | can_read issue with Net::SSL |
Date: | Mon, 15 Sep 2014 12:54:01 +0100 |
To: | bug-Net-HTTP [...] rt.cpan.org |
From: | hv [...] crypt.org |
My $work app has encountered a problem that I believe is identical to
rt#81237, but with Net::SSL rather than IO::Socket::SSL as the underlying
socket library.
Our current plan to address this is to upgrade to latest Crypt::SSLeay
(which exposed the 'pending' method in a recent change) and then apply
the following local patch (against Net-HTTP-6.06, but should apply over
6.07 as well):
--- lib/perl5/Net/HTTP/Methods.pm.old 2013-03-10 22:35:43.000000000 +0000
+++ lib/perl5/Net/HTTP/Methods.pm 2014-09-15 14:05:38.000000000 +0100
@@ -284,6 +284,7 @@
my $self = shift;
return 1 unless defined(fileno($self));
return 1 if $self->isa('IO::Socket::SSL') && $self->pending;
+ return 1 if $self->isa('Net::SSL') && $self->pending;
# With no timeout, wait forever. An explict timeout of 0 can be
# used to just check if the socket is readable without waiting.
It looks like the support for pending() came in between 0.65_02 and 0.65_04
of Crypt::SSLeay, so it isn't obvious how Net::HTTP should incorporate
a similar fix - if you're using an older Crypt::SSLeay you'll get something
like:
Can't locate object method "pending" via package "LWP::Protocol::https::Socket" at lib/perl5/Net/HTTP/Methods.pm line 287.
Hugo