Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LWP::UserAgent: https requests via http proxy

173 views
Skip to first unread message

Andrew Tkachenko

unread,
Aug 28, 2002, 10:40:01 AM8/28/02
to
Hello All.
Does anyone know how to make request for https document using regular
http proxy and LWP::UserAgent ? Is it possible or not ?
DOes that mean that proxy should support https protocol or it does not
matter at all ?
Any links to docs on proxy would be greatly appriciated

Thanks for advance, Andrew

Manuel Streuhofer

unread,
Aug 28, 2002, 11:20:23 AM8/28/02
to


--- copied from README.SSL -- libwww package -- START ---


SSL SUPPORT
-----------

The libwww-perl package has support for using SSL/TLSv1 with its HTTP
client and server classes. This support makes it possible to access https
schemed URLs with LWP. Because of the problematic status of encryption
software in general and certain encryption algorithms in particular, in
several countries, libwww-perl package doesn't include SSL functionality
out-of-the-box.

Encryption support is obtained through the use of Crypt::SSLeay or
IO::Socket::SSL, which can both be found from CPAN. While libwww-perl has
"plug-and-play" support for both of these modules (as of v5.45), the
recommended module to use is Crypt::SSLeay. In addition to bringing SSL
support to the LWP package, IO::Socket::SSL can be used as an object
oriented interface to SSL encrypted network sockets.

There is yet another SSL interface for perl called Net::SSLeay. It has a
more complete SSL interface and can be used for web client programming
among other things but doesn't directly support LWP.

The underlying SSL support in all of these modules is based on OpenSSL
<http://www.openssl.org/> (formerly SSLeay). For WWW-server side SSL
support (e.g. CGI/FCGI scripts) in Apache see <http://www.modssl.org/>.


--- copied from README.SSL -- libwww package -- END ---

and yes. it works more than fine. i'm using it daily without any problems.
Manuel

--
Anti-spam e-mail address, sorry for the inconvenience!
Manuel.Streuhofer /*AT*/ manito /*DOT*/ at

Brian McCauley

unread,
Aug 28, 2002, 1:23:33 PM8/28/02
to
Andrew Tkachenko <pobu...@peterlink.ru> writes:

> Does anyone know how to make request for https document using regular
> http proxy and LWP::UserAgent ?

There are two ways you can access an HTTPS server via a proxy.

You can use the HTTP proxy CONNECT command or you can do it like you
would with FTP or HTTP.

Most browsers use the CONNECT approach.

LWP AFAIK does not.

Most proxies support the CONNECT approach.

Some proxies (e.g. Apache+mod_proxy) also support the other approach.

> DOes that mean that proxy should support https protocol or it does not
> matter at all ?

Yes, if you use a proxy with LWP then the proxy needs to support HTTPS
(and LWP does not need to support HTTPS).

So if I have an HTTPS enabled proxy running on localhost:80 then the
following Perl script can fetch an HTTPS page even if SSL support for
Perl is not installed.

#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;

my $ua = LWP::UserAgent->new;
$ua->proxy( https => 'http://localhost/' );
my $req = HTTP::Request->new(GET => 'https://login.yahoo.com/');

my $res = $ua->request($req);
print $res->as_string;
__END__


> Any links to docs on proxy would be greatly appriciated

Do you mean the concepts...

ftp://ftp.isi.edu/in-notes/rfc2616.txt

...or a particular implementation...

http://httpd.apache.org/docs-2.0/mod/mod_proxy.html

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\

0 new messages