js1 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm having a problem with LWP. Here's my script:
!/opt/perl-5.8.0/bin/perl use LWP; use LWP::Debug qw(level); level('+'); my $browser = LWP::UserAgent->new; $browser->credentials( 'csgl02:8082', 'Blue Coat Proxy SG', 'u452359' +=> 'abc123'); my $url='https://csgl02:8082/Secure/Local/console/documentation.htm'; my $response = $browser->get($url); die "Error: ", $response->header('Blue Coat Proxy SG') || 'Error acces +sing', #('WWW-Authenticate' is the realm-name) "\n ", $response->status_line, "\n at $url\n Aborting" unless $response->is_success; print $response->content; exit;
smpd9$ ./test.pl LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: GET https://csgl02:8082/Secure/Local/con +sole/documentation.htm LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 25 bytes LWP::UserAgent::request: Simple response: Unauthorized LWP::UserAgent::request: () LWP::UserAgent::send_request: GET https://csgl02:8082/Secure/Local/con +sole/documentation.htm LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 41 bytes LWP::UserAgent::request: Simple response: Unauthorized Error: Error accessing 401 Authentication Required at https://csgl02:8082/Secure/Local/console/documentation.htm Aborting at ./test.pl line 32. smpd9$
I'm sure the credentials are right as I have tested in a browser. Any ideas what might be going wrong or how I can get some more info?
Thanks,
js1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP Credentials
by iburrell (Chaplain) on Jun 17, 2004 at 16:01 UTC | |
by Anonymous Monk on Jun 17, 2004 at 21:45 UTC |