Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.xs.dll' for module Net::SSLeay: load_file:The specified module could not be found (LWP::Protocol::https not installed)
The (second) script that you provided works fine for me on 64-bit Strawberry Perl 5.32.1.1.
I'm therefore pretty certain that there's something broken in your environment - perhaps some interference from some old perl installation.
I think you should be able to reproduce that error by simply trying to "use Net::SSLeay" :
perl -MNet::SSLeay -e 1
I added a bit to your script, to reveal the contents of $response:
use LWP::UserAgent;
use HTTP::Request::Common;
$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
my ($response_content, $response_status);
my $userAgent = LWP::UserAgent->new();
$userAgent->agent("PhilPerl");
my $request = HTTP::Request->new();
$request->method('GET');
$request->uri('https://perlmonks.org');
my $response = $userAgent->request($request);
if ($response->is_success) {
print $response->decoded_content;
}
else {
die $response->status_line;
}
For me, that worked fine and successfully retrieved the requested page.
Even if I effectively remove LWP::Protocol::https (by renaming perl/vendor/lib/LWP/Protocol/https.pm to perl/vendor/lib/LWP/Protocol/https.pm_hide) the script still runs fine.
However, in this instance, $response merely contains the message "501 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed) at try.pl line 21."
In addition to the checks already mentioned, take a look at what's in your PATH (
perl -le "print $ENV{PATH}) as that's what SSLeay.xs.dll searches (in sequence) for the dlls it needs.
And it will load the first one it finds whose name (case-insensitively) matches the name it's looking for.
Your SSLeay.xs.dll needs to load msvcrt.dll, kernel32.dll, libcrypto-1_1-x64__.dll, libssl-1_1-x64__.dll and perl532.dll.
The first 2 are system files - there should be no problem there.
The last one is the perl-5.32.x dll - there should be no problem there unless there's another perl532.dll found earlier in the path.
And the remaining 2 are given such StrawberryPerl-specific names that it's very unlikely there's a problem there.
It's a bit of a mystery !!
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.