From 8a5e1ed2884ed6388f1bd610e825cee226fbc299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Mon, 26 Jan 2026 21:28:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=81=E4=B9=A6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BAip=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/acme/client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/acme/client.go b/pkg/acme/client.go index dcae226e..29380eb1 100644 --- a/pkg/acme/client.go +++ b/pkg/acme/client.go @@ -3,6 +3,7 @@ package acme import ( "context" "crypto/x509" + "net" "sort" "github.com/libdns/libdns" @@ -79,6 +80,13 @@ func (c *Client) UsePanel(ip []string, conf string, webServer string) { // ObtainCertificate 签发 SSL 证书 func (c *Client) ObtainCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error) { + // IP 地址 + for _, san := range sans { + if net.ParseIP(san) != nil { + return c.ObtainIPCertificate(ctx, sans, keyType) + } + } + certPrivateKey, err := generatePrivateKey(keyType) if err != nil { return Certificate{}, err