use strict; use warnings; use Test::More tests => 2; use LWP::UserAgent; my $ua = LWP::UserAgent->new; isnt get_cw ($ua), 'Peer certificate not verified', 'Verify = no warning'; $ua->ssl_opts (verify_hostname => 0); is get_cw ($ua), 'Peer certificate not verified', 'No Verify = warning'; sub get_cw { my $lpw = shift; my $res = $lpw->head ('https://www.perlmonks.org/'); my $cw = $res->header ('Client-SSL-Warning') // ''; return $cw; }