https / proxy problem

https / proxy problem

Secure Home | Search | About
 General Computer Security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content add this group's latest topics to your Google content
Subject Author Date
https / proxy problem Larry 01-11-2006
Posted by Larry on January 11, 2006, 10:59 am
If you were  Registered and logged in, you could reply and use other advanced thread options
I have a script on Windows which uses LWP to make a simple GET request
through a proxy:

#!/usr/bin/perl

use strict;
use warnings;
use LWP::UserAgent;

my $url = "https://mysite.com";

my $ua = LWP::UserAgent->new;
$ua->proxy(['http', 'https'] => 'http://myproxy.org:80');
my $response = $ua->get( $url );

$response->is_success or
die "Failed to GET '$url': ", $response->status_line;

print $response->as_string, "\n";

I also have Crypt::SSLeay installed so that I can access https sites.
When I try to run the script as above, it prints some HTTP headers and
an HTML-formatted error message from the firewall server which says
"Scheme not supported".

However:

-If I change $url to point to a an http site, the script will
successfully fetch the page, and

- If I change $url to point to an internal https server and comment out
the proxy setting line, the script will successfully get the internal
page.

I checked my proxy settinng in Internet Explorer and both http and
https are set to myproxy.org on port 80 (server name changed to protect
privacy)

Anybody know why I can't reach remote https sites?


Posted by Juha Laiho on January 11, 2006, 11:27 am
If you were  Registered and logged in, you could reply and use other advanced thread options
>I have a script on Windows which uses LWP to make a simple GET request
>through a proxy:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use LWP::UserAgent;
>
> my $url = "https://mysite.com";
>
> my $ua = LWP::UserAgent->new;
> $ua->proxy(['http', 'https'] => 'http://myproxy.org:80');
> my $response = $ua->get( $url );
>
> $response->is_success or
> die "Failed to GET '$url': ", $response->status_line;
>
> print $response->as_string, "\n";
>
>I also have Crypt::SSLeay installed so that I can access https sites.
>When I try to run the script as above, it prints some HTTP headers and
>an HTML-formatted error message from the firewall server which says
>"Scheme not supported".

Could it be that LWP does not support HTTP 'CONNECT' method for working
with proxies? As it is this what is needed to proxy https requests:
you first make a 'CONNECT' request to the proxy, and then place your
https traffic in the connection that the proxy opened for you.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)

Similar ThreadsPosted
SSL Proxy / How to forward HTTPS connections? August 12, 2005, 6:29 am
SSL Proxy / How to forward HTTPS connections? August 14, 2005, 7:14 am
Proxy June 15, 2005, 1:31 am
Hiding ip with proxy June 29, 2005, 7:35 am
Re: Know about a proxy server? January 2, 2007, 1:15 pm
Re: Know about a proxy server? January 2, 2007, 7:21 pm
Palm with anonymous proxy December 21, 2004, 10:30 pm
Auto Proxy Login?? Please help March 14, 2005, 4:39 am
Proxy sign messages July 26, 2005, 12:58 pm
Website still sees my IP while using proxy September 23, 2005, 8:48 am

The site map in XML format XML site map

Contact Us | Privacy Policy