prabhuksmani has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I'm new to perl, I'm working in windows Xp environment, I want to acess a https sites. I found LWP Module supports to access http sites via OpenSSL and Crypt::Ssleay.

I downloaded and installed OpenSSL in c:\openssl and i installed Crypt::Ssley module too.

Perl Command Line Interpreter shows a error report that ssleay32.dll encounters a problem.

Please help me to solve the problem or any other approach to acess the https sites.

code part:

#!/usr/bin/perl use LWP 5.64; my $url = 'https://www.paypal.com/'; # Yes, HTTPS! my $browser = LWP::UserAgent->new; my $response = $browser->get($url); die "Error at $url\n ", $response->status_line, "\n Aborting" unless $response->is_success; print "Whee, it worked! I got that ", $response->content_type, " document!\n";
advance thanks to all monks.
with regards
Prabhu.S.M
prabhuksmani@gmail.com

Replies are listed 'Best First'.
Re: Accessing HTTPS Sites
by gube (Parson) on Mar 13, 2006 at 07:03 UTC
    I'd use WWW::Mechanize.
    use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get( "https://adwords.google. +com/select/TrafficEstimatorSandbox +" ); $mech->submit_form ( form_number => 0, fields => { "login.userid" => 'xxx', "login.password" => 'xxxx', } );
Re: Accessing HTTPS Sites
by McDarren (Abbot) on Mar 13, 2006 at 06:15 UTC
    Works fine for me.

    Exactly what is the error that you get?
    Is ssleay32.dll accessible via your PATH variable?

      I am having a similar problem. When i run the program below I get the error: Error: 500 Connect failed: connect: Unknown error; Also how can i change the $ua->agent('Mozilla/5.0'); to take the microsoft xp browser?
      #!/usr/local/bin/perl $ENV{"HTTP_PROXY"} = "http://http-proxy:xx"; $ENV{"HTTP_PROXY_USER"} = "xxxx"; $ENV{"HTTP_PROXY_PASS"} = "xxxx"; use LWP::UserAgent; use XML::RSS; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET=> 'https://www.paypal.com/'); $ua->env_proxy(); $ua->agent('Mozilla/5.0'); $res = $ua->request($req); if ($res->is_success) { #print ($res->content); printf "fetched %d bytes\n", length($res->content); } else { print "Error: " . $res->code . " " . $res->message; }
      Thank you Akhila