Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-03-29 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found