Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: "certificate verify failed" error while trying to connect to https:// site using use WWW::Mechanize

by sam_bakki (Pilgrim)
on Jul 18, 2011 at 09:02 UTC ( #915109=note: print w/ replies, xml ) Need Help??


in reply to Re: "certificate verify failed" error while trying to connect to https:// site using use WWW::Mechanize
in thread "certificate verify failed" error while trying to connect to https:// site using use WWW::Mechanize

Hi rkrieger

I have exported the certificate (in my case it is COMODOHigh-AssuranceSecureServerCA ) from internet explorer to a directory as a .cer file.

After that I set


$ENV{HTTPS_CA_DIR} = 'C:\temp\cert'; $ENV{HTTPS_DEBUG} = 1; $ENV{HTTP_DEBUG} = 1;

but still it is not working , I get the same Error GETing https://www.collabnet.nxp.com/sf/sfmain/do/home: Can't connect to www.collabnet.nxp.com:443 (certificate verify failed) error

Thanks


Comment on Re^2: "certificate verify failed" error while trying to connect to https:// site using use WWW::Mechanize
Download Code
Re^3: "certificate verify failed" error while trying to connect to https:// site using use WWW::Mechanize
by rkrieger (Friar) on Jul 18, 2011 at 09:58 UTC

    First off: check whart sort of format you exported from your browser. You'll want PEM (plain base64 text with a -----BEGIN CERTIFICATE----- line at start). Try opening your file in a text editor and check if that's what you have. Export in different formats or convert your current file to PEM format (see the OpenSSL manual for that or the openssl) man page on a Unix system.

    In short: when using HTTPS_CA_DIR you need a directory with PEM certificates in files named according to the hash of their (certificate) subject name. Perhaps HTTPS_CA_FILE is more useful for you (if you only have a single CA certificate to handle).

    Why? The CA file directory should hold files in so-called PEM format and follow the instructions as listed in Crypt::SSLeay under Client Certificate Support. In fact, that points to the OpenSSL docs again with more instructions.

      Hi rkrieger

      I ran the same script , which uses WWW::Mechanize to download https:// content. Which works like a charm :) any way thanks again for your advise and information about certificates.

      Another good reason to hate MS Windows :)

      Thanks
      Bakkiaraj M

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-12-26 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls