From 44efcea14a6219628d9acc9b468b700a8a7abf2c Mon Sep 17 00:00:00 2001 From: v-me-50 Date: Mon, 29 Dec 2025 16:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E5=A4=87?= =?UTF-8?q?=E7=94=A8=E5=90=8D=E7=A7=B0=E6=8F=90=E5=8F=96=E4=B8=8D=E5=88=B0?= =?UTF-8?q?IP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/monitor/check.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/internal/monitor/check.go b/backend/internal/monitor/check.go index ac25ebd..6049f75 100644 --- a/backend/internal/monitor/check.go +++ b/backend/internal/monitor/check.go @@ -72,7 +72,14 @@ func Check(certs []*x509.Certificate, host string, advanceDay int) (result *Cert result.NotBefore = leafCert.NotBefore.In(time.Local).Format("2006-01-02 15:04:05") result.NotAfter = leafCert.NotAfter.In(time.Local).Format("2006-01-02 15:04:05") result.DaysLeft = int(leafCert.NotAfter.Sub(time.Now()).Hours() / 24) - result.SANs = strings.Join(leafCert.DNSNames, ",") + // ๆๅ– SAN ๅˆ—่กจ + SANs := leafCert.DNSNames + if len(leafCert.IPAddresses) > 0 { + for _, ip := range leafCert.IPAddresses { + SANs = append(SANs, ip.String()) + } + } + result.SANs = strings.Join(SANs, ",") result.SignatureAlgo = leafCert.SignatureAlgorithm.String() sha256Sum := sha256.Sum256(leafCert.Raw) result.Sha256 = hex.EncodeToString(sha256Sum[:])