Check also certificate keys using elliptic curve algorithms
This commit is contained in:
parent
301499dc52
commit
8aa2516a55
1 changed files with 12 additions and 2 deletions
|
@ -617,8 +617,18 @@ const internalCertificate = {
|
||||||
fs.unlinkSync(filepath);
|
fs.unlinkSync(filepath);
|
||||||
return true;
|
return true;
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
fs.unlinkSync(filepath);
|
return utils.exec('openssl ec -in ' + filepath + ' -check -noout')
|
||||||
throw new error.ValidationError('Certificate Key is not valid (' + err.message + ')', err);
|
.then((result) => {
|
||||||
|
if (!result.toLowerCase().includes('key ok')) {
|
||||||
|
throw new error.ValidationError(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.unlinkSync(filepath);
|
||||||
|
return true;
|
||||||
|
}).catch((err) => {
|
||||||
|
fs.unlinkSync(filepath);
|
||||||
|
throw new error.ValidationError('Certificate Key is not valid (' + err.message + ')', err);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue