|
Posted by l.g.h on February 22, 2005, 7:43 am
Please log in for more thread options
Hello,
I'm trying to use LWP module to access a secured website via a proxy (
standard proxy which forward to a ms proxy server )
Symptoms:
I can access successfully any non-secure website (http), but when I try
show/hide quoted text
to access a https website, I got "<html></html>" as data and a 200
response code from the http server.
An application ( such as Mozilla ) with the same proxy parameters
access successfully to any secured or non secured websites.
With Ethereal, the only difference seems to be that mozilla/ie uses the
CONNECT directive instead of the GET directive of LWP.
And when mozilla/ie receive a 200 "connection etablished", they send
another "CONNECT" request to the proxy, and then get successfully the
requested webpage.
So I used the CONNECT method too. But it doesn't works better.
Here's what I wrote: ( I use activestate perl 5.8.4 )
___________________________________
show/hide quoted text
$ua = LWP::UserAgent->new(redirect => '5');
$ua->proxy('http', 'http://127.0.0.1:5865/');
$ua->proxy('https', 'http://127.0.0.1:5865/');
show/hide quoted text
$request = new HTTP::Request CONNECT => 'https://www.axabanque.fr/'; #
same issue with GET
show/hide quoted text
$response = $ua->request($request);
print $response->as_string;
show/hide quoted text
if ($response->is_success) {
print $response->content . $response->as_string;
}
else {
show/hide quoted text
die $response->status_line . $response->as_string;
}
______________________________________
Thanks in advance for any ideas ...
Luc
|