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