do not generate ssl vhost with fallback ssl-certificate if file does not exist, fixes #614

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-16 20:21:53 +01:00
parent aa90747089
commit 8b0966d332
3 changed files with 30 additions and 0 deletions

View File

@@ -429,6 +429,11 @@ class apache extends HttpConfigBase
if ($row_ipsandports['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {
if ($row_ipsandports['ssl_cert_file'] == '') {
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
if (!file_exists($row_ipsandports['ssl_cert_file'])) {
// explicitly disable ssl for this vhost
$row_ipsandports['ssl_cert_file'] = "";
$this->logger->logAction(CRON_ACTION, LOG_DEBUG, 'System certificate file "'.Settings::Get('system.ssl_cert_file').'" does not seem to exist. Disabling SSL-vhost for "'.Settings::Get('system.hostname').'"');
}
}
if ($row_ipsandports['ssl_key_file'] == '') {
@@ -928,6 +933,11 @@ class apache extends HttpConfigBase
if ($ssl_vhost === true && $domain['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {
if ($domain['ssl_cert_file'] == '') {
$domain['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
if (!file_exists($domain['ssl_cert_file'])) {
// explicitly disable ssl for this vhost
$domain['ssl_cert_file'] = "";
$this->logger->logAction(CRON_ACTION, LOG_DEBUG, 'System certificate file "'.Settings::Get('system.ssl_cert_file').'" does not seem to exist. Disabling SSL-vhost for "'.$domain['domain'].'"');
}
}
if ($domain['ssl_key_file'] == '') {