From 9560e8f24ac07ab1af858581ebaed45634f184e4 Mon Sep 17 00:00:00 2001 From: Tristan <39345534+MichelBaie@users.noreply.github.com> Date: Sat, 12 Dec 2020 21:41:37 +0100 Subject: [PATCH] Allow every type of privkey It cause problems with self generated clouflare keys --- backend/internal/certificate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js index 3725c1c8..7776dbde 100644 --- a/backend/internal/certificate.js +++ b/backend/internal/certificate.js @@ -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') ) {