Allow every type of privkey

It cause problems with self generated clouflare keys
This commit is contained in:
Tristan 2020-12-12 21:41:37 +01:00
parent 72ac549a58
commit 9560e8f24a

View file

@ -615,7 +615,7 @@ const internalCertificate = {
checkPrivateKey: (private_key) => {
return tempWrite(private_key, '/tmp')
.then((filepath) => {
let key_type = private_key.includes('-----BEGIN RSA') ? 'rsa' : 'ec';
let key_type = private_key.includes('-----BEGIN') ? 'rsa' : 'ec';
return utils.exec('openssl ' + key_type + ' -in ' + filepath + ' -check -noout 2>&1 ')
.then((result) => {
if (!result.toLowerCase().includes('key ok') && !result.toLowerCase().includes('key valid') ) {