1
mirror of https://github.com/rclone/rclone synced 2024-10-18 04:15:01 +02:00

ftp: Add no_check_certificate option for FTPS

This commit is contained in:
Gary Kim 2019-05-20 08:24:46 +08:00 committed by Nick Craig-Wood
parent 2890b69c48
commit db8cd1a993

View File

@ -49,13 +49,18 @@ func init() {
Required: true,
}, {
Name: "tls",
Help: "Use FTP over TLS, leave blank for (false)",
Help: "Use FTP over TLS (Implicit)",
Default: false,
}, {
Name: "concurrency",
Help: "Maximum number of FTP simultaneous connections, 0 for unlimited",
Default: 0,
Advanced: true,
}, {
Name: "no_check_certificate",
Help: "Do not verify the TLS certificate of the server",
Default: false,
Advanced: true,
},
},
})
@ -69,6 +74,7 @@ type Options struct {
Port string `config:"port"`
TLS bool `config:"tls"`
Concurrency int `config:"concurrency"`
SkipVerifyTLSCert bool `config:"no_check_certificate"`
}
// Fs represents a remote FTP server
@ -130,6 +136,7 @@ func (f *Fs) ftpConnection() (*ftp.ServerConn, error) {
if f.opt.TLS {
tlsConfig := &tls.Config{
ServerName: f.opt.Host,
InsecureSkipVerify: f.opt.SkipVerifyTLSCert,
}
ftpConfig = append(ftpConfig, ftp.DialWithTLS(tlsConfig))
}