feat: 优化泛域名申请证书手动解析值 (#5950)

Refs https://github.com/1Panel-dev/1Panel/issues/4609
This commit is contained in:
zhengkunwang 2024-07-26 14:59:40 +08:00 committed by GitHub
parent 3b057f2c27
commit 50efe607d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import (
"crypto"
"encoding/json"
"os"
"strings"
"time"
"github.com/1Panel-dev/1Panel/backend/app/model"
@ -292,8 +293,12 @@ func (c *AcmeClient) GetDNSResolve(domains []string) (map[string]Resolve, error)
continue
}
challengeInfo := dns01.GetChallengeInfo(domain, keyAuth)
fqdn := challengeInfo.FQDN
if strings.HasPrefix(domain, "*.") && strings.Contains(fqdn, "*.") {
fqdn = strings.Replace(fqdn, "*.", "", 1)
}
resolves[domain] = Resolve{
Key: challengeInfo.FQDN,
Key: fqdn,
Value: challengeInfo.Value,
}
}