Hello,

I've investigated a little bit this problem, and I wonder if this could be caused by a bug in Net::SSLeay 1.85 which seems to be resolved in version 1.86_06 (not yet released on CPAN) via https://github.com/radiator-software/p5-net-ssleay/pull/56/commits/f67e75f2b50fa72da9a5111abc13b2bd06d33650.

For the record, here's a debugging session of the "LWP::UserAgent->new->post("https://facebook.com";, { data => "foo" }) or die" command:

root@vm-cyrille-debian:~# perl -d -MLWP::UserAgent -e 'LWP::UserAgent->new->post("https://facebook.com";, { data => "foo" }) or die'

Loading DB routines from perl5db.pl version 1.53
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(-e:1): LWP::UserAgent->new->post("https://facebook.com";, { data => "foo" }) or die
  DB<1> s
LWP::UserAgent::new(/usr/share/perl5/LWP/UserAgent.pm:23):
23: Carp::croak("Options to LWP::UserAgent should be key/value pairs, not hash reference")
24:             if ref($_[1]) eq 'HASH';
  DB<1> c 206
LWP::UserAgent::CODE(0x55d48645fdf0)(/usr/share/perl5/LWP/UserAgent.pm:206):
206: $response = $protocol->request($request, $proxy, $arg, $size, $self->{timeout}) || die "No response returned by $protocol";
  DB<2> s
LWP::Protocol::http::request(/usr/share/perl5/LWP/Protocol/http.pm:127):
127:        my($self, $request, $proxy, $arg, $size, $timeout) = @_;
  DB<2> c 377
LWP::Protocol::http::request(/usr/share/perl5/LWP/Protocol/http.pm:377):
377:                    my $n = $socket->sysread($buf, 1024, length($buf));
  DB<3> s
IO::Socket::SSL::sysread(/usr/share/perl5/IO/Socket/SSL.pm:1150):
1150:       my $self = shift;
  DB<3> c 1109
IO::Socket::SSL::_generic_read(/usr/share/perl5/IO/Socket/SSL.pm:1109):
1109:       $SSL_ERROR = $! = undef;
  DB<4> v
1106:       my $ssl =  ${*$self}{_SSL_object} || return;
1107:       my $buffer=\$_[2];
1108
1109==>          $SSL_ERROR = $! = undef;
1110:       my ($data,$rwerr) = $read_func->($ssl, $length);
1111:       while ( ! defined($data)) {
1112: if ( my $err = $self->_skip_rw_error( $ssl, defined($rwerr) ? $rwerr:-1 )) {
1113:               if ($err == $Net_SSLeay_ERROR_SYSCALL) {
1114                    # OpenSSL 1.1.0c+ : EOF can now result in SSL_read 
returning -1
1115:                   if (not $!) {
  DB<4> n
IO::Socket::SSL::_generic_read(/usr/share/perl5/IO/Socket/SSL.pm:1110):
1110:       my ($data,$rwerr) = $read_func->($ssl, $length);
  DB<4> s


This is where the code "hangs", and $read_func is actually Net::SSLeay::read

Br,

Cyrille

Reply via email to