Re: Crypt::OpenSSL Proposal
Brian Strand (bstrand@carclub.com)
Fri, 26 Feb 1999 18:48:41 -0800
Regarding your request for a simple command-line https get script, the
following works for me:
#!/usr/bin/perl
use strict;
use MIME::Base64;
use Net::SSLeay qw(get_https);
my $user_id = 'your user id';
my $password = 'your password';
my $auth_basic_cookie = encode_base64("$user_id:$password");
print "using auth basic cookie: $auth_basic_cookie\n";
my ($page, $response, %response_headers) = get_https(
"your.server.here",
443,
"/your/path/here",
"Authorization: Basic $auth_basic_cookie"
);
print "got back:\n$page";
__END__
Admittedly crude, and should be modified to actually take a url as an
argument rather than hard-coding it, but this was just a quick and dirty
script for testing the feasibility of doing batched SSL transfers.
This script requires Net::SSLeay for encryption and MIME::Base64 for the
user/password bit (see RFC 1945, section 10.2 or RFC 2068, section 14.8
for more info).
Good Luck!