libwww-perl / libwww-perl/Net-HTTP

Failing with Net::HTTP [rt.cpan.org #72790]

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
20
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Migrated from rt.cpan.org#72790 (status was 'open')

Requestors:

  • HINDMARSH@cpan.org

From hindmarsh@cpan.org on 2011-11-28 23:22:03:

Ref - RT#72580

"I just removed it in commit 208a2e384a176237. We'll se if anybody
complains."

It seems that it breaks pretty quickly if Net::SSL is required.

Sample code:

use Net::SSL;
$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS}="Net::SSL";
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $res = $ua->get('https://foo.com/bar');

read failed:  at
/home/ashley/ms5_lib_20111014/lib/perl5/Net/HTTP/Methods.pm line 256
 at
/home/ashley/ms5_lib_20111014/lib/perl5/i686-linux-gnu-thread-multi/Net/SSL.pm
line 211

We can't switch to IO::Socket::SSL - it doesn't handle our PKCS certs,
or our proxy.

From ppisar@redhat.com on 2011-12-21 15:31:31:

We hit problem with chunked HTTPS response. GETting
<https://bugzilla.redhat.com/show_bug.cgi?id=1> results in truncated
body. Net::HTTP croak about mallformed chunk is added into headers but
no error is reported to LWP::UserAgent. Actually the response is valid
and fully parseble by Net::HTTP if carried on plain TCP. I think
IO::Socket::SSL truncates or splits the response data chunk decoder does
not expect it. 

See for more details (https://bugzilla.redhat.com/show_bug.cgi?id=768394).

From aharrison@cpan.org on 2012-01-03 15:52:49:

I stumbled on this bug myself.

When I took ppisar's suggestion of reverting the change in RT#72580, the 
problem goes away.

I'm running perl-5.14.2, built via perlbrew on Dec 27, 2011 (with -
Dusethreads and -Dnoextensions=ODB_File) on an old CentOS 5.2 server with 
module versions libwww-perl 6.02 and IO::Socket::SSL 1.53.

Let me know if I can provide any other details that would be helpful.

-- 
Andy

From gaas@cpan.org on 2012-01-03 19:48:23:

I've restored the blocking override for Net::SSL in <https://github.com/gisle/libwww-perl/commit/6049e9d9eb2e22693053ad2af5ddba2b6824ac66>.
IO::Socket::SSL is supposed to handle blocking correctly so I need to investigate what goes wrong in that case some more.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining Net/HTTP/Methods.pm around line 256 and Net/SSL.pm around line 211, then reproduce the sample LWP::UserAgent HTTPS request with Net::SSL and a chunked response. Compare the behavior with the blocking override restored in commit 6049e9d9eb2e22693053ad2af5ddba2b6824ac66e; done means the HTTPS response is read completely and failures are reported correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.