Maybe the following works:

$ua = WWW::Mechanize->new( ssl_opts => { verify_hostname => 0, } );