From 29494b71fa0e86fabbb5f1799d2a4c0686bd2fb7 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 15 Jan 2016 09:40:59 +0100 Subject: [PATCH] do not create vhost content for ssl-vhosts that do not have a ssl-certificate specified, fixes #1583 Signed-off-by: Michael Kaufmann (d00p) --- scripts/jobs/cron_tasks.inc.http.10.apache.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 82f36bb2..6dce1c8e 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -818,6 +818,13 @@ class apache extends HttpConfigBase { $vhost_content .= ' SSLCertificateChainFile ' . makeCorrectFile($domain['ssl_cert_chainfile']) . "\n"; } } + else + { + // if there is no cert-file specified but we are generating a ssl-vhost, + // we should return an empty string because this vhost would suck dick, ref #1583 + $this->logger->logAction(CRON_ACTION, LOG_ERROR, $domain['domain'] . ' :: empty certificate file! Cannot create ssl-directives'); + return '# no ssl-certificate was specified for this domain, therefore no explicit vhost is being generated'; + } } if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {