#!/servers/web/bin/perl -w use strict; use IO::Socket::SSL; use LWP::UserAgent; use Data::Dumper; ### LWP Stuff $ENV{HTTPS_VERSION} = '3'; # CLIENT CERT SUPPORT ### These ENV variables are required by LWP, there ### exists no other method of telling LWP which ### certificates should be used. my $certdbpath = "/some/cert/path/conf/"; $ENV{HTTPS_CERT_FILE} = "$certdbpath/client.crt"; $ENV{HTTPS_KEY_FILE} = "$certdbpath/client.key"; callforte(); exit; ############################################## sub callforte { print "This is libwww-perl-$LWP::VERSION\n"; print STDERR "This is libwww-perl-$LWP::VERSION\n"; # Check we have permission to read the certificates. open CERT, $ENV{HTTPS_CERT_FILE} or die "not cert :("; open KEY, $ENV{HTTPS_KEY_FILE} or die "not key :("; my $ua = new LWP::UserAgent; my $req = new HTTP::Request('POST', 'https://machine.edu.au:123443/cgi-bin/fortecgi?'. 'pagename=CheckForte'); # This is an HTML form $req->content_type('application/x-www-form-urlencoded'); $req->content("dummy_input=1"); my $res = $ua->request($req); print STDERR $res->code."\n"; print STDERR $res->content(), "\n"; print Dumper($res); return ""; }