I'm trying to get SSLeay working under Solaris with the Perl libraries. I've
installed SSLeay 0.6.6 as well as Crypt-SSLeay-0.06, both of which compiled,
tested, and installed without any errors.

However, when it comes to use the library in Perl, I'm having problems. All I
want to do is connect to a Secure Web Server and retrieve a document. My code
is something like:

-----
#!/usr/local/bin/perl

   use Net::SSL;
   $|=1;

   print "Content-type: text/html\n\n";
   
   $sock = Net::SSL->new(PeerAddr => "secure.site.name",
                         PeerPort => 443) || die "Can't connect";
   # The normal HTTP protocol
   $sock->print("GET / HTTP/1.0\n\n");
   while ($sock->read($buf, 1024)) {
        print $buf;
   }
   print $sock->get_peer_certificate->subject_name, "\n";
   print $sock->get_cipher, "\n";
-----

The result of this is strange;
   - When running as a CGI from the webserver, it fails to connect (ie; dies
at the ->new line)
   - When run from the command line, it prints some garbage characters (I
suspect from within the new() fn), and then sits there

I suspect from the command line it is connecting, but don't know why it's
printing this instead of returning the handle...

Anyone have any ideas what's going wrong here??

Any ideas on how I can do what I want to do?? (I'd like a perl solution, but
anything'd do for the moment. Tried ssltelnet with no luck installing it...)

Help!

Thanks in advance ...

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: CWIS Technical Officer         -           [EMAIL PROTECTED] : 
| IT Services                       -               Murdoch University | 
 >------------------- Member of the #SAS# & #CFC# --------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /
+-------------------------------------------------------------------------+
| Administrative requests should be sent to [EMAIL PROTECTED] |
| List service provided by Open Software Associates, http://www.osa.com/  |
+-------------------------------------------------------------------------+

Reply via email to