mirror of https://github.com/certd/certd
fix: 修复pfxPassword无效的bug
parent
d3ba3254f1
commit
251e450fab
|
@ -21,12 +21,12 @@ export class CertConverter {
|
||||||
const certReader = new CertReader(opts.cert);
|
const certReader = new CertReader(opts.cert);
|
||||||
let pfxPath: string;
|
let pfxPath: string;
|
||||||
let derPath: string;
|
let derPath: string;
|
||||||
const handle = async (opts: CertReaderHandleContext) => {
|
const handle = async (ctx: CertReaderHandleContext) => {
|
||||||
// 调用openssl 转pfx
|
// 调用openssl 转pfx
|
||||||
pfxPath = await this.convertPfx(opts);
|
pfxPath = await this.convertPfx(ctx, opts.pfxPassword);
|
||||||
|
|
||||||
// 转der
|
// 转der
|
||||||
derPath = await this.convertDer(opts);
|
derPath = await this.convertDer(ctx);
|
||||||
};
|
};
|
||||||
|
|
||||||
await certReader.readCertFile({ logger: this.logger, handle });
|
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 { tmpCrtPath, tmpKeyPath } = opts;
|
||||||
|
|
||||||
const pfxPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", "cert.pfx");
|
const pfxPath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", "cert.pfx");
|
||||||
|
|
Loading…
Reference in New Issue