ftpd: advertise TLS support only if really enabled

if we don't have a global TLS configuration, advertise TLS only on the
bindings where it is configured instead of failing at runtime

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-08-21 15:48:29 +02:00
parent 5d4145900f
commit a592e388cd
6 changed files with 56 additions and 15 deletions

View File

@@ -240,7 +240,10 @@ func (b *Binding) GetTLSDescription() string {
return "Implicit"
}
return "Plain and explicit"
if certMgr.HasCertificate(common.DefaultTLSKeyPaidID) || certMgr.HasCertificate(b.GetAddress()) {
return "Plain and explicit"
}
return "Disabled"
}
// PortRange defines a port range