in reply to Mechanize and Bypassing SSL Certificate Check

$ua->ssl_opts(verify_hostname => 0);

See LWP::UserAgent and search for $ua->ssl_opts.

Update: Gah. The OP was talking about WWW::Mechanize.

WWW::Mechanize passes its constructor arguments up to its parent (LWP::UserAgent). Try this:
use WWW::Mechanize; my $mech = WWW::Mechanize->new( ssl_opts => { verify_hostname => 0, }, );

Replies are listed 'Best First'.
Re^2: Mechanize and Bypassing SSL Certificate Check
by Anonymous Monk on Aug 25, 2011 at 17:07 UTC
    Thanks, it works. But how come this didn't work?
    $mech->ssl_opts( verify_hostname => 0 );
    I thought Mechanize inherited most of the methods from LWP::UserAgent.

    Because if I tried this which is from LWP::UserAgent, it works fine.
    $mech->timeout( 100 );
      What do you mean exactly by "this didn't work"? Can you call the method ->ssl_opts on the $mech object?

      After you use WWW::Mechanize; what is the value of $LWP::UserAgent::VERSION and $WWW::Mechanize::VERSION?