Discussion:
Net::Ftp
Duncan Garland
2018-08-23 20:44:01 UTC
Permalink
Hernan Lopes
2018-08-23 21:23:43 UTC
Permalink
When the client dont implement FTPS, dont forget you can use
https://www.stunnel.org/ as a TLS layer for example.
Hi,
Has anybody got any examples of using Net::Ftp with FTPS?
It isn't obvious even from browsing the source code.
All the best.
Duncan
Mark Overmeer
2018-08-23 21:45:16 UTC
Permalink
Has anybody got any examples of using Net::Ftp with FTPS?
It isn't obvious even from browsing the source code.
All the best.
Net::FTPSSL or Net::SSLGlue::FTP
--
success,
MarkOv

------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
***@Overmeer.net ***@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
Yitzchak Scott-Thoennes
2018-08-23 22:14:57 UTC
Permalink
On 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)?
GARLAND DUNCAN
2018-08-24 07:50:17 UTC
Permalink
Hi,

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-Thoennes
On 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)?
GARLAND DUNCAN
2018-08-24 08:28:45 UTC
Permalink
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 DUNCAN
Hi,
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-Thoennes
On 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)?
Loading...