fix: 修复pfxPassword无效的bug

pull/199/head
xiaojunnuo 2024-09-30 13:52:18 +08:00
parent d3ba3254f1
commit 251e450fab
1 changed files with 4 additions and 4 deletions

View File

@ -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");