use strict;
use warnings;
use v5.10;

use LWP::UserAgent;
my $ua1 = LWP::UserAgent->new;
my $ua2 = LWP::UserAgent->new;
$ua2->ssl_opts(
    SSL_verifycn_scheme => {
        check_cn => 'when_only',
        wildcards_in_alt => 0,
        wildcards_in_cn => 0,
    }
);
for my $ua ($ua1, $ua2) {
    my $req = HTTP::Request->new(GET => 'https://encrypted.google.com/');
    my $res = $ua->request($req);
    say $res->status_line;
}
