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

feat: acme ari支持,close #1192

This commit is contained in:
2026-01-08 22:09:08 +08:00
parent 2d525e9680
commit 978c9b2fc3
4 changed files with 72 additions and 30 deletions

View File

@@ -2,6 +2,7 @@ package acme
import (
"context"
"crypto/x509"
"sort"
"github.com/libdns/libdns"
@@ -92,8 +93,8 @@ func (c *Client) ObtainCertificate(ctx context.Context, sans []string, keyType K
return Certificate{PrivateKey: pemPrivateKey, Certificate: crt}, nil
}
// ObtainShortCertificate 签发短期 SSL 证书
func (c *Client) ObtainShortCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error) {
// ObtainIPCertificate 签发 IP SSL 证书
func (c *Client) ObtainIPCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error) {
certPrivateKey, err := generatePrivateKey(keyType)
if err != nil {
return Certificate{}, err
@@ -174,6 +175,11 @@ func (c *Client) GetDNSRecords(ctx context.Context, domains []string, keyType Ke
return data.([]DNSRecord), nil
}
// GetRenewalInfo 获取续签建议
func (c *Client) GetRenewalInfo(ctx context.Context, cert x509.Certificate) (acme.RenewalInfo, error) {
return c.zClient.GetRenewalInfo(ctx, &cert)
}
func (c *Client) selectPreferredChain(certChains []acme.Certificate) acme.Certificate {
if len(certChains) == 1 {
return certChains[0]