RE: [Crypt::SSLeay] CA certificate trust verification with LWP HTTPS communication
am 09.06.2005 01:32:19 von IGunawan635HI Chris,
Congratulations on the effort making LWP works with Crypt::SSLeay. Can
you share your code how you did it. I've working on this for a while
and still no luck.
Here is my code:
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use Crypt::SSLeay;
LWP::Debug::level('+conns');
LWP::Debug::level('+trace');
LWP::Debug::level('+debug');
# HTTPS Proxy Support
$ENV{HTTPS_PROXY} =3D 'http://sa1isa4:80';
# PROXY_BASIC_AUTH
$ENV{HTTPS_PROXY_USERNAME} =3D 'username'; $ENV{HTTPS_PROXY_PASSWORD} =3D
'password'; # DEBUGGING SWITCH / LOW LEVEL SSL DIAGNOSTICS
$ENV{HTTPS_DEBUG} =3D 1; =20
# DEFAULT SSL VERSION
$ENV{HTTPS_VERSION} =3D '3';
#$ENV{HTTPS_CERT_FILE} =3D 'C:/Perl/certs/cert.pem'; #$ENV{HTTPS_KEY_FILE}
=3D 'C:/Perl/certs/cert.pem'; $ENV{HTTPS_CA_FILE} =3D
'val.banking.worldsavings.com.cer';
$ENV{HTTPS_CA_DIR} =3D 'C:/Perl/certs/';
my $browser =3D LWP::UserAgent->new();
#$browser->proxy('http', 'http://sa1isa4:80/');
$request =3D HTTP::Request->new (GET =3D>
'https://val.banking.worldsavings.com/wsb/WDSHeartBeat?heart beat=3DPWS');
$response =3D $browser->request($request);
=09
my $content;
if ( $response->is_error() ) {
printf "unable to connect to $WDSHeartBeat{$dbname}, response:
%s\n", $response->status_line;
exit;
}
$list =3D $response->content();
I am using ActivePerl 5.6, I install openssl-0.9.7c-bin.exe,
libwww-perl-5.64, libnet-1.19 and Cypt-SSLeay.
I can access the HTTPS through browser and it has a certificate. I
downloaded the certificate and saved it to C:\Perl\certs directory and
named it 'val.banking.worldsavings.com.cer'.
I am still getting this error:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET
https://val.banking.worldsavings.com/wsb/WDSHeartBeat?heartb eat=3DPWS
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error unable
to connect to
https://val.banking.worldsavings.com/wsb/WDSHeartBeat?heartb eat=3DPWS,
response: 500 proxy connect failed: PROXY ERROR HEADER, could be non-SSL
URL: HTTP/1.1 407 Proxy Authentication Required ( The ISA Server
requires authorization to fulfill the request. Access to the Web Proxy
service is denied. ) Via:1.1 SA1ISA4
Proxy-Authenticate: NTLM
Proxy-Authenticate: Kerberos
Proxy-Authenticate: Negotiate
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 2375
2">