Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Mechanize and Bypassing SSL Certificate Check

by repellent (Priest)
on Aug 25, 2011 at 01:39 UTC ( [id://922246]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://922246]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found