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

fix: cert eab save

This commit is contained in:
耗子
2024-10-13 00:07:02 +08:00
parent fb94c015b2
commit 1b2f9ea1d2

View File

@@ -50,6 +50,8 @@ func (r certAccountRepo) Create(req *request.CertAccountCreate) (*biz.CertAccoun
if eabErr != nil {
return nil, eabErr
}
account.Kid = eab.KeyID
account.HmacEncoded = eab.MACKey
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CAGoogleCN, eab, acme.KeyType(account.KeyType))
case "google":
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CAGoogle, &acme.EAB{KeyID: account.Kid, MACKey: account.HmacEncoded}, acme.KeyType(account.KeyType))
@@ -62,6 +64,8 @@ func (r certAccountRepo) Create(req *request.CertAccountCreate) (*biz.CertAccoun
if eabErr != nil {
return nil, eabErr
}
account.Kid = eab.KeyID
account.HmacEncoded = eab.MACKey
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CAZeroSSL, eab, acme.KeyType(account.KeyType))
case "sslcom":
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CASSLcom, &acme.EAB{KeyID: account.Kid, MACKey: account.HmacEncoded}, acme.KeyType(account.KeyType))
@@ -105,6 +109,8 @@ func (r certAccountRepo) Update(req *request.CertAccountUpdate) error {
if eabErr != nil {
return eabErr
}
account.Kid = eab.KeyID
account.HmacEncoded = eab.MACKey
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CAGoogleCN, eab, acme.KeyType(account.KeyType))
case "google":
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CAGoogle, &acme.EAB{KeyID: account.Kid, MACKey: account.HmacEncoded}, acme.KeyType(account.KeyType))
@@ -117,6 +123,8 @@ func (r certAccountRepo) Update(req *request.CertAccountUpdate) error {
if eabErr != nil {
return eabErr
}
account.Kid = eab.KeyID
account.HmacEncoded = eab.MACKey
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CAZeroSSL, eab, acme.KeyType(account.KeyType))
case "sslcom":
client, err = acme.NewRegisterAccount(context.Background(), account.Email, acme.CASSLcom, &acme.EAB{KeyID: account.Kid, MACKey: account.HmacEncoded}, acme.KeyType(account.KeyType))