Hi,
I'm trying to get CPAN's Net::FTPSSL working from my linux dev env.
I installed the dependent modules (Net::SSLeay IO::Socket::SSL) and
they seemed to work as expected. The following are the test scripts :
------------------------------------------------------------------------
#!/usr/bin/perl
# Test for 'Net::SSLeay' module
# Get a page via HTTP and print some info about it.
use Net::SSLeay;
($site, $port, $path) = @ARGV;
die "Usage: ./get_page.pl oraclestore.oracle.com 443 /\n"
unless $path;
($page, $result, %headers) = &Net::SSLeay::get_https($site,
$port, $path);
print "Result was `$result'\n";
foreach $h (sort keys %headers) {
print "Header `$h'\tvalue `$headers{$h}'\n";
}
print "=================== Page follows =================\n";
print $page;
------------------------------------------------------------------------
#!/usr/bin/perl
# Test for 'IO::Socket::SSL' module
use IO::Socket::SSL;
my $client = new
IO::Socket::SSL("oraclestore.oracle.com:https");
if (defined $client) {
print $client "GET / HTTP/1.0\r\n\r\n";
print <$client>;
close $client;
} else {
warn "I encountered a problem: ",
IO::Socket::SSL::errstr();
}
------------------------------------------------------------------------
Also, I have OpenSSL configured properly, The stcontent server's
Implicit FTPS port is 2101:
------------------------------------------------------------------------
bash-2.05b$ /usr/local/ssl/bin/openssl s_client -connect
stcontent.oracle.com:2101
CONNECTED(00000003)
depth=1 /C=US/O=RSA Data Security, Inc./OU=Secure Server
Certification Authority
...
------------------------------------------------------------------------
However, I get an error while testing the Net::FTPSSL module :
'/*SSL connect attempt failederror:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol at ./net_ftp_ssl.pl
line 5*/'. The following is the script I used :
------------------------------------------------------------------------
#!/usr/bin/perl
# Test for 'Net::FTPSSL' module
use Net::FTPSSL;
my $ftps = Net::FTPSSL->new('stcontent.oracle.com',
port => 2101,
encryption
=> 'I',
debug => 1)
or die "Can't open stcontent.oracle.com";
$ftp->login('ashok.kumar.subramanian', 'password')
or die "Can't login: ", $ftps->$last_message();
$ftps->cwd("/pub") or die "Can't change directory: ",
$ftps->last_message;
$ftps->get("file") or die "Can't get file: ",
$ftps->last_message;
$ftps->quit();
------------------------------------------------------------------------
I would appreciate if someone could point out the reason for this
error and a possible workaround.
Thanks - Ashok