develooper Front page | perl.libwww | Postings from February 2003

RE: how to fetch https pages

Thread Previous | Thread Next
Wenjie Wang
February 11, 2003 15:47
RE: how to fetch https pages
Message ID:
Hi Lance,

It all sounds familiar :-)  Actually, I've sort of experiencing the same
problem before.  After finds out SSL support is needed and have it
installed, It'll be an easy task.  But it's a bit tricky if you're behind a
fire wall. It'll be even trickier if you're on a dialup connection behind a
fire wall.  As a matter of fact, I'm still struggling with it.

The following code snip works fine to fetch page from SSL site when Using
LWP v5.64 under Perl v5.006001 MSWin32.  btw, I've also have OpenSSL
installed on c:\openssl.

# PROXY SUPPORT for SSLeay module
# It'll be unhappy if using
# $myUserAgent->proxy (http => $ENV{HTTPS_PROXY}) at the same time;
$ENV{HTTPS_PROXY} = 'http://your.proxy:port';
$ENV{HTTP_PROXY} = 'http://your.proxy:port';

# No need to keep_alive if you're not going to keep the session alive
$myUserAgent = LWP::UserAgent->new(keep_alive => 2);


# optional, but you are most likely need a cookie jar
$myUserAgent->cookie_jar({});  # turn on in-memory cookies.

my $req = new HTTP::Request 'POST','';

# It depends on the contents your server are expecting

# submit your request
my $myResponse = $myUserAgent->request($req);

die "complain it before leaving...\n" if ($myResponse->is_error);

The above code works fine, except when I use it from my home pc which is
connected to my office via dialup.  It always complains "unknown host" for
some servers which happen running IIS.  I'm still struggling with the
problem and still haven't got a clue what's the problem.

>-----Original Message-----
>From: Lance []
>Sent: Tuesday, 11 February 2003 9:21 PM
>Subject: Re: how to fetch https pages
>"Lance" <> wrote in message
>> What modules have to be installed for LWP::UserAgent to read SSL
>pages?  I
>> have been trying to install Crypt-SSLeay, but I keep getting the message:
>> 'Error: no suitable installation target found for package Crypt-SSLeay.'
>> I am using ActiveState 5.6.1-build 633 on win XP
>> I have been trying to use ppm3 to do the install, is there a way
>to get it
>> to list dependances of modules you are trying to install?  The docs say
>> it will automatically install dependant modules, but it does not seem to
>> working for me!
>OK, I finally found out why Crypt-SSLeay won't install.  It is a
>Solaris-only module!  I used 'describe Crypt-SSLeay' in ppm3 to find this
>out.  So the next question is:  How can I use my perl script to read https
>pages?  I keep getting a 501 http error code - protocol not available.
>The LWP docs say to use Crypt-SSLeay, btw.  But no alternatives.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About