Improve log message about redundant TLS certificate
This commit is contained in:
parent
3d7633f4a6
commit
ea750ad813
2 changed files with 6 additions and 6 deletions
|
@ -107,7 +107,7 @@ func (c *Certificates) CreateTLSConfig(entryPointName string) (*tls.Config, erro
|
||||||
config.Certificates = append(config.Certificates, *cert)
|
config.Certificates = append(config.Certificates, *cert)
|
||||||
} else {
|
} else {
|
||||||
for _, certificate := range *c {
|
for _, certificate := range *c {
|
||||||
err := certificate.AppendCertificates(domainsCertificates, entryPointName)
|
err := certificate.AppendCertificate(domainsCertificates, entryPointName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Unable to add a certificate to the entryPoint %q : %v", entryPointName, err)
|
log.Errorf("Unable to add a certificate to the entryPoint %q : %v", entryPointName, err)
|
||||||
continue
|
continue
|
||||||
|
@ -138,8 +138,8 @@ func (c *Certificates) isEmpty() bool {
|
||||||
return key == len(*c)
|
return key == len(*c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AppendCertificates appends a Certificate to a certificates map sorted by entrypoints
|
// AppendCertificate appends a Certificate to a certificates map keyed by entrypoint.
|
||||||
func (c *Certificate) AppendCertificates(certs map[string]map[string]*tls.Certificate, ep string) error {
|
func (c *Certificate) AppendCertificate(certs map[string]map[string]*tls.Certificate, ep string) error {
|
||||||
|
|
||||||
certContent, err := c.CertFile.Read()
|
certContent, err := c.CertFile.Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -192,9 +192,9 @@ func (c *Certificate) AppendCertificates(certs map[string]map[string]*tls.Certif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if certExists {
|
if certExists {
|
||||||
log.Warnf("Into EntryPoint %s, try to add certificate for domains which already have this certificate (%s). The new certificate will not be append to the EntryPoint.", ep, certKey)
|
log.Warnf("Skipping addition of certificate for domain(s) %q, to EntryPoint %s, as it already exists for this Entrypoint.", certKey, ep)
|
||||||
} else {
|
} else {
|
||||||
log.Debugf("Add certificate for domains %s", certKey)
|
log.Debugf("Adding certificate for domain(s) %s", certKey)
|
||||||
certs[ep][certKey] = &tlsCert
|
certs[ep][certKey] = &tlsCert
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ func (m *Manager) UpdateConfigs(stores map[string]Store, configs map[string]TLS,
|
||||||
conf.Stores = []string{"default"}
|
conf.Stores = []string{"default"}
|
||||||
}
|
}
|
||||||
for _, store := range conf.Stores {
|
for _, store := range conf.Stores {
|
||||||
if err := conf.Certificate.AppendCertificates(storesCertificates, store); err != nil {
|
if err := conf.Certificate.AppendCertificate(storesCertificates, store); err != nil {
|
||||||
log.Errorf("Unable to append certificate %s to store %s: %v", conf.Certificate.GetTruncatedCertificateName(), store, err)
|
log.Errorf("Unable to append certificate %s to store %s: %v", conf.Certificate.GetTruncatedCertificateName(), store, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue