Dear Monks

I am trying to connect to https web site (actually it is collabnet site, we have project tracker in it) and trying to download some content.

Since it is password protected page, I used WWW::Mechanize module. (Activeperl 5.14, x64, windows 7). I do have Crypt::SSLeay comes with ActivePerl 5.14

When I tried to get the content from web site using below code, I get Error GETing https://www.collabnet.com/: Can't connect to www.collabnet.com:443 (certificate verify failed) Error

What I know is, I need to set HTTPS_CA_DIR path but i do not know where should I point this in windows os. This https://www.collabnet.com/ is perfectly working using internet explorer.

Here is my code, Please help me to solve this problem. Thanks in Advance

use strict; use warnings; use WWW::Mechanize; use Crypt::SSLeay; #Globals my $browser; my $url; #Down load the CCB search queries $browser=WWW::Mechanize->new(agent=>'Windows IE 6',cookie_jar => {},no +proxy =>1); #$url=http://www.google.com - works $url='https://www.collabnet.com/'; $browser->get($url); print $browser->content(format=>'text');

UPDATE: Solved :)
Hi Monks,
I have solved this problem. I do not want my perl application to verify host certificate, so I exported following environment variable ,
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
Everything works well :)

Learning: Need to read LWP doc properly


In reply to "certificate verify failed" error while trying to connect to https:// site using use WWW::Mechanize by sam_bakki

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.