I'm using Perl 5.16.3 on RHEL 7 and I have a fairly generic request:
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::UserAgent() ;
use URI::Escape ;
use IO::Socket::SSL ;
my $PhoneNo = "<Some phone number>" ;
my $SomeMsg = "Some message" ;
my $BaseURL = 'https://api.clickatell.com/http/sendmsg?user=someuser&password=somepassword' ;
my $EncSomeMsg = uri_escape($SomeMsg) ;
my $SendURL = sprintf("%s&to=%s&text=%s",$BaseURL,$PhoneNo,$EncSomeMsg) ;
my $ua = LWP::UserAgent->new(
timeout => 10,
ssl_opts => {
verify_hostname => 1,
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER,
},
) ;
#$ua->ssl_opts(SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER) ; # Causes error 'Can't locate object method "ssl_opts" via package "LWP::UserAgent"'
my $contents = $ua->get($SendURL) ;
printf("Returned: %s\n",$contents) ;
However it still returns:
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER possibly with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
These are the versions of the modules:
LWP::UserAgent: 2.033LWP::Protocol::https:(didn't return a version)IO::Socket::SSL: 1.94
Why is it ignoring my request to verify the peer?