my $ua = LWP::UserAgent->new();
my $res = $ua->get("https://url");
print $res->content;
Resulted in a response that the certificate was not valid (and if I disabled hostname verification the server would say I needed encryption instead), until I started using Net::SSL
:
$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = 'Net::SSL';
Before doing my request, ofc.
Module Versions at the moment:
Crypt::SSLeay 0.58
IO::Socket::SSL 1.955
Net::SSLeay 1.55
LWP 6.05
LWP::Protocol::https 6.04
Also tried the latest Crypt::SSLeay
but that still failed (tried this in a test environment).
Is this just a limitation in the Crypt::SSLeay
library, between the client and the server - that they maybe can't agree upon an encryption method?
I also used OpenSSL
to manually connect to the server in question, which worked without problems, no certificate failures or so.
My problem is sort of solved already, but not in a way that feels very graceful, but I am curious as to where the error lies, as I spent ages trying to find a solution, and the root of the issue. I send SSL requests to hundreds of other servers without this problem, but this one server would just respond with a message saying I need to encrypt my request.
Is LWP
together with Net:SSL
more supported?
How would you try and trace the root of the issue?
EDIT: An interesting thing is this didn't happen in older versions of the modules (it worked recently). I strongly suspect that it was LWP or something that got updated. Weird how the behaviour can change like this in an update.