LWP makes use of object oriented paradigms.  When requesting https pages,
the system actually uses the http request code, but the "connection" object
knows that it has to speak https.  This is called polymorphism.

 -----Original Message-----
From:   Luke Butcher [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, June 09, 2000 10:19 AM
To:     '[EMAIL PROTECTED]'
Subject:        LWP::Protocol::https missing methods

I am trying to write a simple script to retrieve a secure page via HTTPS.

The guts of it are:

$url = "https://mysite.com"
$ua = new LWP::UserAgent;
$req = new HTTP::Request GET => $url

$response = $ua->request($req);

It keeps returning: (via $response->status_line, $response->as_html also
returns similar).
500 Can't Connect to mysite.com:443 (Timeout)

So I did some poking, tried hacking up the timeout to 999 - No joy.
So I went looking into the LWP::Protocol packages and did some tracing.

It seems UserAgent.pm nicely determines we are using https and calls
LWP::Protocol::https.pm with a request method but https lacks a request
method??!?!!?!?
It then defaults to http after UserAgent parses the error message and I
guess this is where the timeout comes from as port 443 knows nothing about
HTTP request and demands secure. I suppose if I was to put the web server
non-secure onto port 443 it would work.

Further info: If I point the script to a HTTP:// site all works smashingly.
All requires are properly installed (no error messages and debugging shows
it is correctly stepping into Net:SSL). The box I'm trying to connect to is
IIS, if it makes a difference.

I feel the problem however lies in the fact there is no
LWP::Protocol::https->request method.

Can anyone enlighten me please.


Cheers,
Luke Butcher

Network Analyst
Em: [EMAIL PROTECTED]

Reply via email to