On 16 Dec 2001 at 2:43, Joshua Chamas wrote:

> timotac wrote:
> > 
> > I have a small perl script I wrote that retrieves files using
> > LWP::UserAgent to get files from a cert protected directory off o a web
> > server.  The script works fine on *nix boxes.  Now I have to get it to
> > work on an NT box, and I am new to perl on NT.
> > I installed activestate perl, then mingw.  I compiled openssl, which
> > seemed to work just fine (no error messages) using the included
> > instructions for mingw.
> > Installed the Net::SSLeay package.  Move the script over, changed things
> > 
> 
> Crypt::SSLeay & Net::SSLeay are 2 different things.  With ActiveState perl,
> try to install Crypt::SSLeay for LWP::UserAgent support with the ppm 
> installer at $PERL/bin/ppm.pl or some such, then:
> 
>   ppm> install Crypt-SSLeay
> 
> If it installs a recent enough Crypt::SSLeay, you should be fine.
> If not you can ask activestate to compile the latest version for
> their ppm repository.
> 
> --Josh
> 

I made sure Crypt::SSLeay was installed.  
ppm -query yields Crypt-SSLeay [0.17.1]

the script looks like this:

use LWP::UserAgent;

$ENV{HTTPS_VERSION} = '3';
$ENV{HTTPS_CERT_FILE} = 'd:\certs\mycert.pem'; 
$ENV{HTTPS_KEY_FILE}  = 'd:\certs\mykey.pem';
$ENV{HTTPS_CA_FILE}  = 'd:\certs\server.pem';

$ua = new LWP::UserAgent;
$httpreq = "https://server.com/reports/today.log";
$req = HTTP::Request('GET',"$httpreq");
$res = $ua->request($req);
if ($res->is_error()) {
        print "Return code ", $res->code,"\n";
        print "Message ", $res->message, "\n";
        exit;
}

print "Content:\n", $res->content;


This yields:

Return code 500
Message read failed:


Note that this code works on a linux box, and the https string is valid if entered in 
netscape on the NT box I am attempting to use.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to