2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:40:59 +08:00

feat: 证书管理支持显示ip证书

This commit is contained in:
2026-01-26 21:28:36 +08:00
parent ce88078c58
commit 8a5e1ed288

View File

@@ -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