My symptom is that I cannot use a proxy server with HTTPS requests with LWP. This is apparently a common problem, and the hints on Google and even here all offer a workaround to set the HTTPS_PROXY environment HTTPS_PROXY to use Crypt :: SSLeay.
My specific problem is that LWP :: Protocol :: https loads IO :: Socket :: SSL, not Crypt :: SSLeay. How can I force Crypt :: SSLeay?
My code is:
#!/usr/bin/perl use strict; use warnings; $ENV{HTTPS_PROXY} = 'http://10.0.3.1:3128'; use LWP::UserAgent; my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new('GET','https://www.meritrustcu.org/'); my $res = $ua->request($req); print "$_\n" for grep { $_ =~ /SSL/ } keys %INC;
And it outputs, showing that Crypt :: SSLeay is not used:
Net/SSLeay.pm IO/Socket/SSL.pm /usr/lib/perl5/auto/Net/SSLeay/autosplit.ix /usr/lib/perl5/auto/Net/SSLeay/set_proxy.al /usr/lib/perl5/auto/Net/SSLeay/randomize.al
Just adding explicit use Crypt::SSLeay to my script turned out to be ineffective. It loads the module, but it continues to load IO :: Socket :: SSL and use it for HTTPS requests.
Flimzy
source share