use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->ssl_opts( SSL_ca_file => 'self-signed.pem'); # set verification name explicitly for this test because the # URL does not contain the correct name $ua->ssl_opts( SSL_verfifycn_name => 'foo.bar'); my $res = $ua->get('https://127.0.0.1:4433'); print $res->as_string; #### openssl s_server -cert self-signed.pem -key self-signed.pem -WWW