Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

WWW::Mechanize and https/port 443

by Cody Fendant (Friar)
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". 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.

Replies are listed 'Best First'.
Re: WWW::Mechanize and https/port 443
by hdb (Monsignor) 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 daxim (Curate) 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 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?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2021-04-15 17:09 GMT
Find Nodes?
    Voting Booth?

    No recent polls found