ftp: enable tls session cache by default
This commit is contained in:
parent
29b8c71522
commit
f37b25a2df
1 changed files with 12 additions and 0 deletions
|
@ -116,6 +116,14 @@ Set to 0 to keep connections indefinitely.
|
||||||
Help: "Maximum time to wait for a response to close.",
|
Help: "Maximum time to wait for a response to close.",
|
||||||
Default: fs.Duration(60 * time.Second),
|
Default: fs.Duration(60 * time.Second),
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
|
}, {
|
||||||
|
Name: "tls_cache_size",
|
||||||
|
Help: `Size of TLS session cache for all control and data connections.
|
||||||
|
TLS cache allows to resume TLS sessions and reuse PSK between connections.
|
||||||
|
Increase if default size is not enough resulting in TLS resumption errors.
|
||||||
|
Enabled by default. Use 0 to disable.`,
|
||||||
|
Default: 32,
|
||||||
|
Advanced: true,
|
||||||
}, {
|
}, {
|
||||||
Name: config.ConfigEncoding,
|
Name: config.ConfigEncoding,
|
||||||
Help: config.ConfigEncodingHelp,
|
Help: config.ConfigEncodingHelp,
|
||||||
|
@ -146,6 +154,7 @@ type Options struct {
|
||||||
Port string `config:"port"`
|
Port string `config:"port"`
|
||||||
TLS bool `config:"tls"`
|
TLS bool `config:"tls"`
|
||||||
ExplicitTLS bool `config:"explicit_tls"`
|
ExplicitTLS bool `config:"explicit_tls"`
|
||||||
|
TLSCacheSize int `config:"tls_cache_size"`
|
||||||
Concurrency int `config:"concurrency"`
|
Concurrency int `config:"concurrency"`
|
||||||
SkipVerifyTLSCert bool `config:"no_check_certificate"`
|
SkipVerifyTLSCert bool `config:"no_check_certificate"`
|
||||||
DisableEPSV bool `config:"disable_epsv"`
|
DisableEPSV bool `config:"disable_epsv"`
|
||||||
|
@ -434,6 +443,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (ff fs.Fs
|
||||||
ServerName: opt.Host,
|
ServerName: opt.Host,
|
||||||
InsecureSkipVerify: opt.SkipVerifyTLSCert,
|
InsecureSkipVerify: opt.SkipVerifyTLSCert,
|
||||||
}
|
}
|
||||||
|
if opt.TLSCacheSize > 0 {
|
||||||
|
tlsConfig.ClientSessionCache = tls.NewLRUClientSessionCache(opt.TLSCacheSize)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
u := protocol + path.Join(dialAddr+"/", root)
|
u := protocol + path.Join(dialAddr+"/", root)
|
||||||
ci := fs.GetConfig(ctx)
|
ci := fs.GetConfig(ctx)
|
||||||
|
|
Loading…
Reference in a new issue