This seems to work, or at least it successfully logs in.
Yesterday was a long day. Should have slept on it before posting!
Thanks for your suggestions.
use Net::FTP;
use Try::Tiny
my $ftp = Net::FTP->new($host)
or die "can't connect to ftp server '$host': $@";
my $starttls = 0;
try {
$starttls = $ftp->starttls;
}
catch {
warn "couldn't start TLS because $_\n";
};
warn sprintf "starttls is %s\n", ($starttls ? 'true' : 'false');
$ftp->login($username, $password)
or die "can't login via FTP: ", $ftp->message;
$ftp->quit;
Post by GARLAND DUNCANHi,
Thanks for all your replies.
It "just works" with ordinary ftp.
$ftp = Net::FTP($hostname);
and you're off and running.
I've used it many times over the years.
However, there aren't any examples with SFTP or FTPS.
IO::Socket::SSL is installed.
It doesn't just work it out for itself.
$ftp = Net::FTP($hostname);
returns
"can't login via FTP: Policy requires SSL"
I know we definitely need FTPS and not SFTP.
That's where the docs become unclear.
It looks like
$ftp = Net::FTP($hostname, SSL => 1, Debug => 1);
should do something, but it just hangs.
I haven't tried the other modules suggested yet. It would be preferable to use the same module for FTP and FTPS.
Regards
Duncan
Post by Yitzchak Scott-ThoennesOn Thu, Aug 23, 2018 at 1:44 PM Duncan Garland
Has anybody got any examples of using Net::Ftp with FTPS?
It isn't obvious even from browsing the source code.
The doc makes it sound like it Just Works (if you have IO::Socket::SSL
installed). Is it not working for you?
Or are you talking about using it with Explicit FTPS (aka FTPES)?