Ensure defaultGeneratedCert.main as Subject's CN
This commit is contained in:
parent
9eb804a689
commit
4d6cb6af03
1 changed files with 9 additions and 4 deletions
|
@ -552,8 +552,11 @@ func (p *Provider) resolveDefaultCertificate(ctx context.Context, domains []stri
|
||||||
|
|
||||||
p.resolvingDomainsMutex.Lock()
|
p.resolvingDomainsMutex.Lock()
|
||||||
|
|
||||||
sort.Strings(domains)
|
sortedDomains := make([]string, len(domains))
|
||||||
domainKey := strings.Join(domains, ",")
|
copy(sortedDomains, domains)
|
||||||
|
sort.Strings(sortedDomains)
|
||||||
|
|
||||||
|
domainKey := strings.Join(sortedDomains, ",")
|
||||||
|
|
||||||
if _, ok := p.resolvingDomains[domainKey]; ok {
|
if _, ok := p.resolvingDomains[domainKey]; ok {
|
||||||
p.resolvingDomainsMutex.Unlock()
|
p.resolvingDomainsMutex.Unlock()
|
||||||
|
@ -947,12 +950,14 @@ func (p *Provider) certExists(validDomains []string) bool {
|
||||||
p.certificatesMu.RLock()
|
p.certificatesMu.RLock()
|
||||||
defer p.certificatesMu.RUnlock()
|
defer p.certificatesMu.RUnlock()
|
||||||
|
|
||||||
sort.Strings(validDomains)
|
sortedDomains := make([]string, len(validDomains))
|
||||||
|
copy(sortedDomains, validDomains)
|
||||||
|
sort.Strings(sortedDomains)
|
||||||
|
|
||||||
for _, cert := range p.certificates {
|
for _, cert := range p.certificates {
|
||||||
domains := cert.Certificate.Domain.ToStrArray()
|
domains := cert.Certificate.Domain.ToStrArray()
|
||||||
sort.Strings(domains)
|
sort.Strings(domains)
|
||||||
if reflect.DeepEqual(domains, validDomains) {
|
if reflect.DeepEqual(domains, sortedDomains) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue