Net::SSLeay - access some sites, but not others

Mikhail Seregine (seregine@leland.stanford.edu)
Mon, 28 Jun 1999 16:30:49 -0500


Hello, 

I am new to SSL, (and to Perl even), so please forgive my ignorance.
Before posting here, I tried to look through the list's archives, the
newsgroups, various web pages, CPAN, etc, but I couldn't figure out how
to successfully communicate with https servers. Here's my problem:

I wrote a script using Net::SSLeay (installed w/ SSLeay 0.6.6) that only
tries to (at least for now) retrieve a page from an SSL server.
Unfortunately, it only works with some servers, and produces a
segmentation fault with others. Can any of you suggest how I can fix
this? For instance, should I use OpenSSL instead of SSLeay, and if so,
how do I replace one with the other? Or is my script just wrong?

Thanks in advance,

Mikhail Seregine


Here's some sample output:

*******  A site that works:
[root@ mikhail]# perl ssltest.pl
Please enter secure server name: https://www.kasnetbank.com
        Accessing https://www.kasnetbank.com/
        Result is: HTTP/1.1 200 OK.
        Headers are:
Connection close Content-type text/html Date Mon, 28 Jun 1999 21:01:55
GMT Serve
r Netscape-Enterprise/3.0L

******** A site that doesn't work
[root@ mikhail]# perl ssltest.pl
Please enter secure server name: https://www.pimcofunds.com
        Accessing https://www.pimcofunds.com/
Segmentation fault
[root@ mikhail]#

******** My script
#!/usr/bin/perl

use Net::SSLeay;

# initialize site variables

$port = '443';                  # Default https port
$path = '/';

print "Please enter secure server name: https://";
$site = <STDIN>;
chomp($site);
print "\tAccessing https://$site$path\n";
($page, $result, %headers) = &Net::SSLeay::get_https($site, $port,
$path);
@header_list = %headers;
print "\tResult is: $result.\n\tHeaders
are:\n@header_list\n\n";          
__END__