From cb9bf3ce682f3818c0a6349dd3fbbfd75eb81b52 Mon Sep 17 00:00:00 2001 From: NicoMen Date: Mon, 29 Jan 2018 10:48:03 +0100 Subject: [PATCH] Fix domain names in dynamic TLS configuration --- tls/certificate.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tls/certificate.go b/tls/certificate.go index 09a69bb57..16bf776c1 100644 --- a/tls/certificate.go +++ b/tls/certificate.go @@ -144,7 +144,12 @@ func (c *Certificate) AppendCertificates(certs map[string]*DomainsCertificates, certKey := parsedCert.Subject.CommonName if parsedCert.DNSNames != nil { sort.Strings(parsedCert.DNSNames) - certKey += fmt.Sprintf("%s,%s", parsedCert.Subject.CommonName, strings.Join(parsedCert.DNSNames, ",")) + for _, dnsName := range parsedCert.DNSNames { + if dnsName != parsedCert.Subject.CommonName { + certKey += fmt.Sprintf(",%s", dnsName) + } + } + } certExists := false