You have disabled host name verification; You have not disabled certificate verification.
verify_hostname determines whether "LWP for secure protocol schemes" will connect to servers that have a valid certificate that matches the expected host name "(my emphasis). Setting this parameter to 0 allows you to connect to a server that has a valid certificate but is not specified for the host / hostname you are trying to reach.
To disable certificate authentication (issued by a trusted CA), you want to:
use IO::Socket::SSL; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0, SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE, }, );
Note that disabling any of these options is a bad idea if you are transmitting any sensitive information or are hoping to trust the returned data. With any of these outages, you lose the benefits of SSL and are vulnerable to various man-in-the-middle attacks.
source share