
mozkill
Novice
Mar 10, 2003, 10:49 AM
Post #10 of 11
(8404 views)
|
Re: [mozkill] PPM install of SSLeay
[In reply to]
|
Can't Post
|
|
Ok, basically, after I installed the PPM package, I still had to find some pre-compiled .DLL files from the openSSL distribution. The hard thing was finding a SSLEAY32.DLL file that came in a package with a matching LIBEAY32.DLL file. I wanted to skip the work of trying to compile this thing. Anyways, I found the stuff, and finally got it working. The following script works, just edit it to point at your favorite site that delivers a SSL cert, and it should accept it and make a connection. I tested it and it works fine for me: ---------------------- #!/usr/bin/perl use Net::SSLeay qw(get_https make_headers make_form); print "Content-type: text/html\n\n"; #Uncomment the following line to enable tracing (for debugging) #values are: 0=no debugging, 1=ciphers, 2=trace, 3=dump data $Net::SSLeay::trace = 2; #send data via SSLeay and gather encrypted reply. $host = 'www.yoursite.com'; $script = '/login.jsp'; $port = '443'; $Net::SSLeay::ssl_version = 3; ($replyData, $response, %reply_headers) = get_https($host, $port, "$script"); ####Parse the reponse from the gateway. @replyPairs = split(/&/,$replyData); foreach $replyPair (@replyPairs) { ($name,$value) = split(/=/,$replyPair); $value =~ s/\+/ /g; $value =~ s/%(..)/pack("c",hex($1))/ge; $reply{$name} .= "\0" if (defined($reply{$name})); $reply{$name} .= "$value"; } ####OUTPUT SECTION: #following is a generic unprocessed output of the gateway's response. #you will need to change the code to format it to your site's look and feel #and give your users a more informative result. print "replyData =\n$replyData\nresponse = $response\nreply headers:\n"; foreach $key (keys %reply_headers) { print "$key: $reply_headers{$key}\n"; }
|