Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

WWW::Mechanize and https/port 443

by Cody Fendant (Pilgrim)
on Jul 19, 2013 at 13:25 UTC ( #1045356=perlquestion: print w/ replies, xml ) Need Help??
Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to do a simple request to an https URL with WWW::Mechanize.

I've got Crypt::SSleay, I know the site is up and the URL is correct, regular browsers can connect to it, but all I get is a long wait and the message "can't connect to website.com:443". What should I try?

Edit: WWW::Mechanize can connect to other https sites just fine, for the record. Not sure what that means but it's another clue.

Comment on WWW::Mechanize and https/port 443
Re: WWW::Mechanize and https/port 443
by daxim (Chaplain) on Jul 19, 2013 at 13:38 UTC
      That's logical, but I have done that and it hasn't changed anything.
Re: WWW::Mechanize and https/port 443
by hdb (Prior) on Jul 19, 2013 at 13:40 UTC

    From WWW::Mechanize

    noproxy => [0|1]
    Turn off the automatic call to the LWP::UserAgent env_proxy function.
    This needs to be explicitly turned off if you're using Crypt::SSLeay to access a https site via a proxy server. Note: you still need to set your HTTPS_PROXY environment variable as appropriate.
      Thanks but surely that only applies if there's a proxy server involved, and there isn't, at least not explicitly. I suppose there could be something going on with the ISP. I'll try it.
        Tried that, no change I'm afraid.
Re: WWW::Mechanize and https/port 443
by Kanji (Parson) on Jul 21, 2013 at 04:04 UTC

    LWP::UserAgent defaulted to verifying SSL connections with 6.00, so if you can connect to one site and not another, it's likely a certificate issue.

    If you're sure that the site can be trusted despite a bad certificate (or you just don't care), you can override this behaviour in ssl_opts.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1045356]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-11-28 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (198 votes), past polls