From 251e450fabfe62405bac13e39f2153736c081ef0 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Mon, 30 Sep 2024 13:52:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DpfxPassword=E6=97=A0?= =?UTF-8?q?=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/plugin-cert/src/plugin/cert-plugin/convert.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 a498e70d..6c016105 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts @@ -21,12 +21,12 @@ export class CertConverter { const certReader = new CertReader(opts.cert); let pfxPath: string; let derPath: string; - const handle = async (opts: CertReaderHandleContext) => { + const handle = async (ctx: CertReaderHandleContext) => { // 调用openssl 转pfx - pfxPath = await this.convertPfx(opts); + pfxPath = await this.convertPfx(ctx, opts.pfxPassword); // 转der - derPath = await this.convertDer(opts); + derPath = await this.convertDer(ctx); }; await certReader.readCertFile({ logger: this.logger, handle }); @@ -44,7 +44,7 @@ export class CertConverter { }); } - private async convertPfx(opts: CertReaderHandleContext, pfxPassword?: string) { + private async convertPfx(opts: CertReaderHandleContext, pfxPassword: string) { const { tmpCrtPath, tmpKeyPath } = opts; const pfxPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", "cert.pfx");