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

fix: 面板IP证书续签

This commit is contained in:
2026-01-31 18:40:41 +08:00
parent 2d3250bc51
commit cef8d7caa7
6 changed files with 33 additions and 30 deletions

View File

@@ -76,7 +76,7 @@ func NewPrivateKeyAccount(email string, privateKey string, CA string, eab *EAB,
return nil, err
}
key, err := cert.ParseKey(privateKey)
key, err := cert.ParseKey([]byte(privateKey))
if err != nil {
return nil, err
}

View File

@@ -18,8 +18,8 @@ import (
"time"
)
func ParseCert(crt string) (x509.Certificate, error) {
certBlock, _ := pem.Decode([]byte(crt))
func ParseCert(crt []byte) (x509.Certificate, error) {
certBlock, _ := pem.Decode(crt)
if certBlock == nil {
return x509.Certificate{}, errors.New("invalid PEM block")
}
@@ -31,8 +31,8 @@ func ParseCert(crt string) (x509.Certificate, error) {
return *cert, nil
}
func ParseKey(key string) (crypto.Signer, error) {
keyBlockDER, _ := pem.Decode([]byte(key))
func ParseKey(key []byte) (crypto.Signer, error) {
keyBlockDER, _ := pem.Decode(key)
if keyBlockDER == nil {
return nil, errors.New("invalid PEM block")
}