From ad0b60a560bb3d5917973f39a2be579885344cf6 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 5 Aug 2021 08:43:41 -0700 Subject: [PATCH] Fix for #2989 server crash due to #2986. --- certoperations.js | 2 +- webserver.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/certoperations.js b/certoperations.js index 28dfd137..9202e444 100644 --- a/certoperations.js +++ b/certoperations.js @@ -175,7 +175,7 @@ module.exports.CertificateOperations = function (parent) { if ((typeof acmconfig.certpfx == 'string') && (typeof acmconfig.certpfxpass == 'string')) { // P12 format, certpfx and certpfxpass - try { r = obj.loadPfxCertificate(obj.parent.common.joinPath(obj.parent.datapath, acmconfig.certpfx), acmconfig.certpfxpass); } catch (ex) { console.log(ex); } + try { r = obj.loadPfxCertificate(parent.common.joinPath(obj.parent.datapath, acmconfig.certpfx), acmconfig.certpfxpass); } catch (ex) { console.log(ex); } if ((r == null) || (r.certs == null) || (r.keys == null) || (r.certs.length < 2) || (r.keys.length != 1)) continue; } else if ((typeof acmconfig.certfiles == 'object') && (typeof acmconfig.keyfile == 'string')) { // PEM format, certfiles and keyfile diff --git a/webserver.js b/webserver.js index e1b8929a..0d4cad5f 100644 --- a/webserver.js +++ b/webserver.js @@ -5916,7 +5916,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if ((typeof domain.authstrategies.saml.cert != 'string') || (typeof domain.authstrategies.saml.idpurl != 'string')) { console.log('ERROR: Missing SAML configuration.'); } else { - const certPath = common.joinPath(obj.parent.datapath, domain.authstrategies.saml.cert); + const certPath = obj.common.joinPath(obj.parent.datapath, domain.authstrategies.saml.cert); var cert = obj.fs.readFileSync(certPath); if (cert == null) { console.log('ERROR: Unable to read SAML IdP certificate: ' + domain.authstrategies.saml.cert); @@ -5999,7 +5999,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if ((typeof domain.authstrategies.jumpcloud.cert != 'string') || (typeof domain.authstrategies.jumpcloud.idpurl != 'string')) { console.log('ERROR: Missing JumpCloud SAML configuration.'); } else { - var cert = obj.fs.readFileSync(common.joinPath(obj.parent.datapath, domain.authstrategies.jumpcloud.cert)); + var cert = obj.fs.readFileSync(obj.common.joinPath(obj.parent.datapath, domain.authstrategies.jumpcloud.cert)); if (cert == null) { console.log('ERROR: Unable to read JumpCloud IdP certificate: ' + domain.authstrategies.jumpcloud.cert); } else {