mirror of
https://github.com/certd/certd.git
synced 2026-04-26 22:07:29 +08:00
fix: pfx兼容windows server 2016
This commit is contained in:
@@ -64,7 +64,10 @@ export class CertConverter {
|
|||||||
if (pfxPassword) {
|
if (pfxPassword) {
|
||||||
passwordArg = `-password pass:${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;
|
return pfxPath;
|
||||||
// const fileBuffer = fs.readFileSync(pfxPath);
|
// const fileBuffer = fs.readFileSync(pfxPath);
|
||||||
// this.pfxCert = fileBuffer.toString("base64");
|
// this.pfxCert = fileBuffer.toString("base64");
|
||||||
|
|||||||
Reference in New Issue
Block a user