mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
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:
@@ -280,6 +280,9 @@ func (s *Server) buildTLSConfig() {
|
||||
if getConfigPath(s.binding.CertificateFile, "") != "" && getConfigPath(s.binding.CertificateKeyFile, "") != "" {
|
||||
certID = s.binding.GetAddress()
|
||||
}
|
||||
if !certMgr.HasCertificate(certID) {
|
||||
return
|
||||
}
|
||||
s.tlsConfig = &tls.Config{
|
||||
GetCertificate: certMgr.GetCertificateFunc(certID),
|
||||
MinVersion: util.GetTLSVersion(s.binding.MinTLSVersion),
|
||||
|
||||
Reference in New Issue
Block a user