From b2bf9efc1a196f8d6d1fd1afdba9c746cbbfb6b4 Mon Sep 17 00:00:00 2001 From: TomyJan Date: Wed, 24 Dec 2025 18:22:36 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20=E8=AF=81=E4=B9=A6=E7=A7=81?= =?UTF-8?q?=E9=92=A5=20EC=20=E6=8C=87=E7=A4=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba418da84c5683b5a8630583a237370dc5b7fe7b. --- app/controller/Cert.php | 8 ++------ app/service/CertOrderService.php | 5 ++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/controller/Cert.php b/app/controller/Cert.php index 33550cd..7768f86 100644 --- a/app/controller/Cert.php +++ b/app/controller/Cert.php @@ -304,9 +304,7 @@ class Cert extends BaseController } } - if ($certInfo['keytype'] == 'ECC') { - $privatekey = CertHelper::ensureECPrivateKeyFormat($privatekey); - } + $privatekey = CertHelper::ensureECPrivateKeyFormat($privatekey); $order = [ 'aid' => 0, @@ -371,9 +369,7 @@ class Cert extends BaseController if ($certInfo['code'] == -1) return json($certInfo); $domains = $certInfo['domains']; - if ($certInfo['keytype'] == 'ECC') { - $privatekey = CertHelper::ensureECPrivateKeyFormat($privatekey); - } + $privatekey = CertHelper::ensureECPrivateKeyFormat($privatekey); $order = [ 'aid' => 0, diff --git a/app/service/CertOrderService.php b/app/service/CertOrderService.php index 0935ec4..6b8f276 100644 --- a/app/service/CertOrderService.php +++ b/app/service/CertOrderService.php @@ -342,7 +342,10 @@ class CertOrderService throw $e; } $this->order['issuer'] = $result['issuer']; - Db::name('cert_order')->where('id', $this->order['id'])->update(['fullchain' => $result['fullchain'], 'privatekey' => $result['private_key'], 'issuer' => $result['issuer'], 'issuetime' => date('Y-m-d H:i:s', $result['validFrom']), 'expiretime' => date('Y-m-d H:i:s', $result['validTo'])]); + + $private_key = CertHelper::ensureECPrivateKeyFormat($result['private_key']); + + Db::name('cert_order')->where('id', $this->order['id'])->update(['fullchain' => $result['fullchain'], 'privatekey' => $private_key, 'issuer' => $result['issuer'], 'issuetime' => date('Y-m-d H:i:s', $result['validFrom']), 'expiretime' => date('Y-m-d H:i:s', $result['validTo'])]); $this->saveResult(3); $this->resetRetry(); }