On Fri, 24 Aug 2001, Joshua Chamas wrote:
> Bob Niederman wrote:
> >
> > I'm using Crypt::SSLeay 0.29 with LWP::UserAgent 1.73.
> >
> > I'm trying to use a proxy. As noted in the doc, $us->proxy() doesn't
> > work.
> >
> > However, the workaround suggested:
> >
> > "
> > $ENV{HTTPS_PROXY} = 'http://proxy_hostname_or_ip:port';
> > $ENV{HTTPS_PROXY} = '127.0.0.1:8080';
> >
> > Use of the HTTPS_PROXY environment variable in this way is compatible
> > with LWP::UserAgent->env_proxy() usage.
> > "
> >
> > Also fails. Attemptinmg this causes an error of:
> >
> > Can't use string ("LWP::UserAgent") as a HASH ref while "strict refs" in
> > use at /usr/lib/perl5/site_perl/5.005/LWP/UserAgent.pm line
> > 612.
> >
>
> LWP::UserAgent->() notation was just talking about the method call...
> did you try setting $ENV{HTTPS_PROXY} directly? Note to use LWP
> calls, you need to create an LWP object.
>
> --Josh
I know to use an object, but misunderstood the statement: "If we could
find the current LWP object executing while in Net::SSLIf we could find
the current LWP object executing while in Net::SSL..." to mean not to do
it this and interpreted your notation literally.
Using the object call gets rid of the 'strict refs' error message, but it
still doesn't work. Code is:
$ENV{HTTPS_PROXY} = "https://$proxy:8080/";
$ENV{HTTP_PROXY} = "http://$proxy:8080/";
$ua->env_proxy();
$agent = 'Lynx/Chicago DMZ monitoring script';
$ua->agent($agent);
for ( 1..3 )
{
$bad = $good = 0;
for $srvr ( @ssl_srvrs, )
# for $srvr ( @http_srvrs, @ssl_srvrs, )
{
$res = '';
$req = new HTTP::Request('GET', "$srvr");
$ress = $ua->request($req);
$res = $ress->content;
etcetera., where $srvr is 'http://servername.domain/file' or
'https://servername.domain/file'
Same general code works fileto the same boxes without proxy (different
route not requiring proxy).
Works fine for http, ethereal shows nothing leaving the box for https, the
$ua->request is failing immediately.
BTW, thanx for the quick response.
- Bob Niederman
> ______________________________________________________________________
> OpenSSL Project http://www.openssl.org
> User Support Mailing List [EMAIL PROTECTED]
> Automated List Manager [EMAIL PROTECTED]
>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]