crabbit has asked for the wisdom of the Perl Monks concerning the following question:

I have tried to install LWP::Protocol::https multiple times. All the dependencies are installed, but I keep getting the following error

This is the only modules I am having issues with

t/example.t ............ # Failed test 'success status' # at t/example.t line 19. # Failed test 'have header Client-SSL-Socket-Class' # at t/example.t line 29. # Failed test 'have header Client-SSL-Cipher' # at t/example.t line 44. # Failed test 'found expected document content' # at t/example.t line 46. # 'Can't connect to www.example.com:443 # # ' # doesn't match '(?^:Example Domain)' t/example.t ............ 1/2 # Looks like you failed 4 tests of 6. # Failed test 'Request GET https://www.example.com' # at t/example.t line 47. # Failed test 'success status' # at t/example.t line 54. t/example.t ............ 2/2 # Looks like you failed 1 test of 2. # Failed test 'Check for warnings from GET https://www.example.com ( +RT #81948)' # at t/example.t line 57. # Looks like you failed 2 tests of 2. t/example.t ............ Dubious, test returned 2 (wstat 512, 0x200) Failed 2/2 subtests t/https_proxy.t ........ ok Test Summary Report ------------------- t/example.t (Wstat: 512 (exited 2) Tests: 2 Failed: 2) Failed tests: 1-2 Non-zero exit status: 2 Files=4, Tests=62, 361 wallclock secs ( 0.02 usr 0.01 sys + 0.53 cus +r 0.07 csys = 0.63 CPU) Result: FAIL Failed 1/4 test programs. 2/62 subtests failed. make: *** [test_dynamic] Error 255 OALDERS/LWP-Protocol-https-6.11.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports OALDERS/LWP-Protocol-https-6.11.tar.gz Failed during this command: OALDERS/LWP-Protocol-https-6.11.tar.gz : make_test NO

Replies are listed 'Best First'.
Re: Installing LWP::Protocol::https Failure
by codiac (Beadle) on Jan 13, 2024 at 08:07 UTC
Re: Installing LWP::Protocol::https Failure
by Bod (Parson) on Jan 13, 2024 at 00:52 UTC

    The first test failure in example.t is getting a webpage from www.example.com

    my $res = $ua->simple_request(HTTP::Request->new(GET => $url)); ok($res->is_success, "success status");

    Do you have a live internet connection whilst trying to install LWP::Protocol::https?

Re: Installing LWP::Protocol::https Failure
by haj (Vicar) on Jan 12, 2024 at 21:45 UTC

    I wonder why you tried multiple times? Did you change something between the attempts?

    You have not told us which platform you are on - but most platforms offer LWP::Protocol::https from their own package management systems (and it is included in Strawberry Perl out of the box). Maybe you can avoid to go through the build cycle?

    If not: The message Failed test 'have header Client-SSL-Socket-Class' might indicate that some non-Perl dependency is missing. The header files like Debian's libcrypt-dev are a likely candidate.

      I wonder why you tried multiple times?

      Perhaps the OP was trying to (dis)prove a famous idea

Re: Installing LWP::Protocol::https Failure
by InfiniteSilence (Curate) on Jan 13, 2024 at 19:57 UTC

    I love metacpan so much I donate to it monthly. Why? Am I just generous? No. The amount of time pales in comparison to my meager contribution. My favorite feature is on the left hand side -- summary test results and links to the CPAN tester's results. Seriously, for me this is religion -- before I bang my head against the wall on a module I need to see those results. For this module I see red. Twenty eight failures spanning successive Perl releases. No. Skip. Look for alternative.

    Celebrate Intellectual Diversity

      And I see 1,389 results that pass. And hundreds of other modules that depend on it so it installs just fine for a ton of people. Besides, a DNS error is hardly a problem when the focus of the code isn't name resolution. They could have installed the module without bothering with the test suite so I'm not sure what the goal is.

      I'd suggest crabbit switch to HTTP::Tiny with SSL support properly installed. Less to bother with because HTTP::Tiny has been a core module for 13 years now.

      For this module I see red. Twenty eight failures spanning successive Perl releases

      But have you looked at the test results of the fails or just that they are red?

      I haven't looked at them all but I checked half a dozen of the fails. Every one I looked at failed in the same place...

      # Failed test 'success status' # at t/example.t line 19. # Failed test 'have header Client-SSL-Socket-Class' # at t/example.t line 29. # Failed test 'have header Client-SSL-Cipher' # at t/example.t line 44. # Failed test 'found expected document content' # at t/example.t line 46. # 'Can't connect to www.example.com:443 (Name do +es not resolve)
      These are all the places that the tests will fail if the host machine cannot retrieve the webpage www.example.com. To me, this would suggest that the problem is not with the module but instead with an incompatibility between the module's needs and the host environment.

      As LWP::Protocol::https is only useful to fetch HTTPS requests, it seems reasonable that the tests fail when the host cannot retrieve a webpage.