Fix domain names in dynamic TLS configuration
This commit is contained in:
parent
49a8cb76f5
commit
cb9bf3ce68
1 changed files with 6 additions and 1 deletions
|
@ -144,7 +144,12 @@ func (c *Certificate) AppendCertificates(certs map[string]*DomainsCertificates,
|
||||||
certKey := parsedCert.Subject.CommonName
|
certKey := parsedCert.Subject.CommonName
|
||||||
if parsedCert.DNSNames != nil {
|
if parsedCert.DNSNames != nil {
|
||||||
sort.Strings(parsedCert.DNSNames)
|
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
|
certExists := false
|
||||||
|
|
Loading…
Reference in a new issue