From e5e468a463f66d02f235de54b7c1e09ace5f1cb1 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Thu, 31 Oct 2024 13:37:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20pfx=E5=85=BC=E5=AE=B9windows=20server=20?= =?UTF-8?q?2016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/plugin-cert/src/plugin/cert-plugin/convert.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts index 2e0377caa..e320a9750 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts @@ -64,7 +64,10 @@ export class CertConverter { if (pfxPassword) { passwordArg = `-password pass:${pfxPassword}`; } - await this.exec(`openssl pkcs12 -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`); + // 兼容server 2016 + const oldPfxCmd = `openssl pkcs12 -macalg SHA1 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`; + // const newPfx = `openssl pkcs12 -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`; + await this.exec(oldPfxCmd); return pfxPath; // const fileBuffer = fs.readFileSync(pfxPath); // this.pfxCert = fileBuffer.toString("base64");