From 8bb2ce272e337f217f4219b2800ac1cf9b81657c Mon Sep 17 00:00:00 2001 From: Wildan M Date: Thu, 14 Nov 2024 11:54:17 +0700 Subject: [PATCH] fix shared ssl --- src/executor/runnersub.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/executor/runnersub.js b/src/executor/runnersub.js index dd07e8b..0b0f724 100644 --- a/src/executor/runnersub.js +++ b/src/executor/runnersub.js @@ -315,14 +315,16 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, } finally { await writeLog("$> Applying nginx ssl config on " + subdomain); await writeLog(await nginxExec.setDirect(subdomain, nginxInfos)); - await writeLog("$> Applying SSL links with global domain"); - await writeLog(await virtualminExec.pushVirtualServerConfig(subdomaindata['ID'], { - 'ssl_same': sharedSSL.id, - 'ssl_key': path.join(sharedSSL.path, 'ssl.key'), - 'ssl_cert': path.join(sharedSSL.path, 'ssl.cert'), - 'ssl_chain': path.join(sharedSSL.path, 'ssl.ca'), - 'ssl_combined': path.join(sharedSSL.path, 'ssl.combined'), - })); + if (sharedSSL) { + await writeLog("$> Applying SSL links with global domain"); + await writeLog(await virtualminExec.pushVirtualServerConfig(subdomaindata['ID'], { + 'ssl_same': sharedSSL.id, + 'ssl_key': path.join(sharedSSL.path, 'ssl.key'), + 'ssl_cert': path.join(sharedSSL.path, 'ssl.cert'), + 'ssl_chain': path.join(sharedSSL.path, 'ssl.ca'), + 'ssl_combined': path.join(sharedSSL.path, 'ssl.combined'), + })); + } } break; case 'root':