Perl help for HTTPS (trying to access a basic auth protected page )
Hello ALL,
I had a very similar problem to the one which was discussed on the forum
which is attached at the bottom of this email. I would appreciate your help
& insight. (Note I have replace he original names by xxxxxxx)
Thanks
Manoj Ostawal
----------------------------------------------------------------------------
---------------------------------------------------
I am getting a
Failed :500 Can't connect to www.xxxxx.com:443 (Bad hostname
'www.xxxxxx.com')
If I try to run the following code
#!/opt/perl/5.6.1/bin/perl
push (@INC, "/opt/NSSLperl/1.13/lib/5.6.1/sun4-solaris/Net" );
push (@INC, "/opt/LWWWperl/5.53/lib/5.6.1");
push (@INC, "/opt/URIperl/1.17/lib/5.6.1");
push (@INC, "/opt/HTMLperl/3.25/lib/5.6.1/sun4-solaris");
push (@INC, "/opt/NSSLperl/1.13/lib/5.6.1/sun4-solaris");
require LWP::UserAgent;
require Net::SSL;
my $ua = new LWP::UserAgent;
my $head = new HTTP::Headers;
$head->authorization_basic('username', 'password');
# SSLServer.COM recognizes this accept-header and triggers the machine-
# friendly output modes...
$head->push_header(Accept => 'text/x-vnd.sslserver-raw');
# this performs the actual request
my $req = new HTTP::Request POST => "https://www.*****.com/", $head;
$req->authorization_basic('username','password);
my $res = $ua->request($req);
if ($res->is_success) {
print $res->content;
} else {
print "Failed :", $res->status_line, "\n";
print "Bad luck this time\n";
}
***********************
This is the first bug I've run into while using (unstable) debian and
I'm not sure which package maintainer deserves a bugreport for this.
I'm attempting to access secure sites using LWP. I'll omit my code
because lwp-request shows the error just fine..
proyal@mars:~$ lwp-request -x <https://www.firstunion.com>
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::simple_request: GET <https://www.firstunion.com>
LWP::UserAgent::_need_proxy: Not proxied
Use of uninitialized value in -r at blib/lib/Net/SSLeay.pm (autosplit
into blib/lib/auto/Net/SSLeay/randomize.al) line 1159.
Use of uninitialized value in -r at blib/lib/Net/SSLeay.pm (autosplit
into blib/lib/auto/Net/SSLeay/randomize.al) line 1163.
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</h1>
500 Can't connect to www.firstunion.com:443 (Timeout)
</BODY>
</HTML>
proyal@mars:~$
I traced the error down to IO::Socket::SSL, in the connect method, the
below line is the one that is failing (#198):
if ( ($r = Net::SSLeay::connect($ssl)) <= 0 ) { # ssl/s23_clnt.c
the $err_str that is returned is:
'error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed'
I'm using:
perl-5.6 5.6.0-6.2
libwww-perl 5.48-3
libnet-socketssl-perl 0.76-1
openssl 0.9.6-1
libnet-ssleay-perl 1.05-3
any suggestions appreciated.
thanks
-pete
--
(peter.royal|osi)@pobox.com - <http://pobox.com/~osi>
your brain on life - <http://fotap.org> - coming soon
uin#153025
**************************
--
To UNSUBSCRIBE, email to debian-perl-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: