Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Net::FTPSSL on Win32 not working as advertised

by perlte58 (Initiate)
on Oct 04, 2010 at 00:50 UTC ( #863217=perlquestion: print w/ replies, xml ) Need Help??
perlte58 has asked for the wisdom of the Perl Monks concerning the following question:

Perl ver: Active State Perl 5.8.9

O/S: WindowsXP SP2

Issue: When using Net::FTPSSL get the following error? Is there another way to do the same thing, another module? Just trying to send an encrypted file via FTP SSL...

Run time error:

Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm (autosplit into blib\lib\auto\Net\SSLeay\randomize.al) line 1944.

Code:

use Net::FTPSSL; my $remote_server = '100.10.100.101'; my $port = 21; my $encryption = 'EXP_CRYPT'; my $login = 'mylogin'; my $passwd = 'mypasswd'; my $file = "myfile"; #------------- my $ftps = Net::FTPSSL->new($remote_server, Port => 21, Encryption => EXP_CRYPT, ) or die "Can not connect to $remote_serv +er"; $ftps->login($login,$passwd) or die "Can not log into $remote_serve +r: " . $ftps->last_message(); $ftps->put($file) or die "Can not put file $file on $remote_server: +" . $ftps->last_message(); $ftps->quit();
Cheers!

Comment on Net::FTPSSL on Win32 not working as advertised
Download Code
Re: Net::FPPSSL on Win32 not working as advertised
by sanju7 (Acolyte) on Oct 04, 2010 at 03:36 UTC

    Hi perlte58:

    Its not very clear if the error is due to any broken module or something. You can always tweak your script a bit to get more output. Like using "Debug" mode and getting return value at every step.

    #!/usr/bin/perl use strict; use warnings; use Net::FTPSSL; my $server = "192.168.2.108"; my $username = "user"; my $passwd = "pass"; my @returnval; my $ftps = Net::FTPSSL->new( $server, Port => 21, Encryption => EXP_CRYPT, Debug => 1) or error("Cannot reach $serv +er"); $ftps->login($username, $passwd) or error("Credential error, $ftps->last_message"); @returnval = $ftps->list() or error("Command error, $ftps->last_message"); $ftps->pwd(); print @returnval;
Re: Net::FPPSSL on Win32 not working as advertised
by syphilis (Canon) on Oct 04, 2010 at 09:32 UTC
    Just trying to send an encrypted file via FTP SSL

    Is that the same as "SFTP" ? If so, Net::SSH2 will do the job - available via ppm:
    ppm install http://theoryx5.uwinnipeg.ca/ppms/Net-SSH2.ppd
    I couldn't get anywhere with Net::FTPSSL trying to connect to an OpenSSH server on a local linux box using the script you provided (having modified the values appropriately) - though the same task is trivial with Net::SSH2.
    Perhaps I simply didn't try hard enough.

    Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm

    That message doesn't make a lot of sense to me. After a module has been correctly installed there should be no need to go looking at anything in "blib" ... let alone that the module being looked at in blib is not even Net::FTPSSL. This smells strongly of a "botched install".

    In addition, that "Run time error" you posted looks to me to be merely a warning (not an error at all) ... yet the script you posted doesn't even "use warnings;", so I'm not sure how that warning comes about. Are you sure that "myfile" didn't get uploaded ?

    Cheers,
    Rob

      Bad install ... had to go to Univ of Winnpeg repository to get a good Net::FTPSSL and Net:SSLeay modules. Just FYI.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://863217]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-11-29 03:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (203 votes), past polls