From 50efe607d495688093b61e12e66c5d88477cf512 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:59:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=B3=9B=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=94=B3=E8=AF=B7=E8=AF=81=E4=B9=A6=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=80=BC=20(#5950)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs https://github.com/1Panel-dev/1Panel/issues/4609 --- backend/utils/ssl/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/utils/ssl/client.go b/backend/utils/ssl/client.go index e3cfd7b3b..253af0e22 100644 --- a/backend/utils/ssl/client.go +++ b/backend/utils/ssl/client.go @@ -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, } }