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

<<<
GIANT EDIT: The error message originally posted here had a root cause that differed from the problem description. It has now been fixed, but the LWP::UserAgent issue still persists. The issue's root cause appears to be the same: something to do with SSL.
>>>>

Using LWP::Simple, it's refusing to connect to a valid SSL endpoint... I've tried
$ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });
... and ...
my $ua = LWP::UserAgent->new();
$ua->ssl_opts( SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE, SSL_hostname => '', verify_hostname => 0 );
... No luck. Any suggestions? Here's what I'm getting back:
WNS Error: HTTP::Response=HASH(0x30e7a30)->content.
$VAR1 = bless( {
'_content' => 'Can\'t connect to ___censored____.com:443

',
'_rc' => 500,
'_headers' => bless( {
'client-warning' => 'Internal response',
'client-date' => 'Tue, 10 Jun 2014 00:47:12 GMT',
'content-type' => 'text/plain',
'::std_case' => {
'client-warning' => 'Client-Warning',
'client-date' => 'Client-Date'
}
}, 'HTTP::Headers' ),
'_msg' => 'Can\'t connect to ___censored__:443',
'_request' => bless( {
'_content' => 'Test Machine - Test Company"Toast Test - Disregard this message"',
'_uri' => bless( do{\(my $o = '__censored :)__')}, 'URI::https' ),
'_headers' => bless( {
'user-agent' => 'libwww-perl/6.06',
'x-wns-cache-policy' => 'no-cache',
'x-wns-type' => 'wns/toast',
'x-wns-ttl' => 600,

I've tried setting environment variables SSL_VERIFY_NONE and PERL_LWP_SSL_VERIFY_HOSTNAME several different ways, no luck.

Any meditations from the monks?
  • Comment on LWP::Simple: Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated!

Replies are listed 'Best First'.
Re: LWP::Simple: Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated!
by perlfan (Parson) on Jun 10, 2014 at 03:10 UTC
Re: LWP::Simple: Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated!
by boftx (Deacon) on Jun 09, 2014 at 23:12 UTC

    I recall having a problem with this many moons ago. I wound up setting the environment variable before calling the constuctor, that worked for me. I've since made it work in other applications by using the ssl_opts. I'll see if I can find that code and post it for you. But in the meantime, set the environment variable to '1' and you should be okay.

    You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
      Thanks. I tried this several different ways (in begin blocks, outside of them, SSL_VERIFY_NONE, PERL_LWP_SSL_VERIFY_HOSTNAME, in the constructor...) ... no luck. I think it's because I did some upgrades relatively recently due to heartbleed, but for the life of me can't figure it out. Any suggestions you can offer are greatly appreciated. I'm stuck!