From 5d3323605080509cf53de5980443c6d02fd50a48 Mon Sep 17 00:00:00 2001 From: Jon Fautley Date: Thu, 10 Oct 2019 18:07:48 +0100 Subject: [PATCH] ftp: allow disabling EPSV mode --- backend/ftp/ftp.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go index 684ade32a..2ece46977 100644 --- a/backend/ftp/ftp.go +++ b/backend/ftp/ftp.go @@ -65,6 +65,11 @@ func init() { Help: "Do not verify the TLS certificate of the server", Default: false, Advanced: true, + }, { + Name: "disable_epsv", + Help: "Disable using EPSV even if server advertises support", + Default: false, + Advanced: true, }, }, }) @@ -79,6 +84,7 @@ type Options struct { TLS bool `config:"tls"` Concurrency int `config:"concurrency"` SkipVerifyTLSCert bool `config:"no_check_certificate"` + DisableEPSV bool `config:"disable_epsv"` } // Fs represents a remote FTP server @@ -144,6 +150,9 @@ func (f *Fs) ftpConnection() (*ftp.ServerConn, error) { } ftpConfig = append(ftpConfig, ftp.DialWithTLS(tlsConfig)) } + if f.opt.DisableEPSV { + ftpConfig = append(ftpConfig, ftp.DialWithDisabledEPSV(true)) + } c, err := ftp.Dial(f.dialAddr, ftpConfig...) if err != nil { fs.Errorf(f, "Error while Dialing %s: %s", f.dialAddr, err)