diff --git a/lib/Froxlor/Api/Commands/SysLog.php b/lib/Froxlor/Api/Commands/SysLog.php index a753fd4fe7..ccbca20de5 100644 --- a/lib/Froxlor/Api/Commands/SysLog.php +++ b/lib/Froxlor/Api/Commands/SysLog.php @@ -225,7 +225,7 @@ public function delete() } $params['trunc'] = $truncatedate; Database::pexecute($result_stmt, $params, true, true); - $this->logger()->logAction($this->isAdmin() ? FroxlorLogger::ADM_ACTION : FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog"); + $this->logger()->logAction(FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog"); return $this->response(true); } throw new Exception("Not allowed to execute given command.", 403); diff --git a/lib/Froxlor/Cron/Http/Apache.php b/lib/Froxlor/Cron/Http/Apache.php index 609f916489..563fac3ab6 100644 --- a/lib/Froxlor/Cron/Http/Apache.php +++ b/lib/Froxlor/Cron/Http/Apache.php @@ -441,7 +441,7 @@ public function createIpPort() if (!empty(Settings::Get('system.dhparams_file'))) { $dhparams = FileDir::makeCorrectFile(Settings::Get('system.dhparams_file')); if (!file_exists($dhparams)) { - FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096'); + file_put_contents($dhparams, self::FFDHE4096); } $this->virtualhosts_data[$vhosts_filename] .= ' SSLOpenSSLConfCmd DHParameters "' . $dhparams . '"' . "\n"; } @@ -754,7 +754,7 @@ protected function getVhostContent($domain, $ssl_vhost = false) if (!empty(Settings::Get('system.dhparams_file'))) { $dhparams = FileDir::makeCorrectFile(Settings::Get('system.dhparams_file')); if (!file_exists($dhparams)) { - FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096'); + file_put_contents($dhparams, self::FFDHE4096); } $vhost_content .= ' SSLOpenSSLConfCmd DHParameters "' . $dhparams . '"' . "\n"; } diff --git a/lib/Froxlor/Cron/Http/HttpConfigBase.php b/lib/Froxlor/Cron/Http/HttpConfigBase.php index 712f625e9e..3bd6e431f2 100644 --- a/lib/Froxlor/Cron/Http/HttpConfigBase.php +++ b/lib/Froxlor/Cron/Http/HttpConfigBase.php @@ -45,6 +45,26 @@ class HttpConfigBase { + /** + * Pre-defined DHE groups to use as fallback if dhparams_file + * is given, but non-existent, see also https://github.com/froxlor/Froxlor/issues/1270 + */ + const FFDHE4096 = <<lighttpd_data[$vhost_filename] .= 'ssl.dh-file = "' . $dhparams . '"' . "\n"; $this->lighttpd_data[$vhost_filename] .= 'ssl.ec-curve = "secp384r1"' . "\n"; @@ -756,7 +756,7 @@ protected function getSslSettings($domain, $ssl_vhost) if (!empty(Settings::Get('system.dhparams_file'))) { $dhparams = FileDir::makeCorrectFile(Settings::Get('system.dhparams_file')); if (!file_exists($dhparams)) { - FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096'); + file_put_contents($dhparams, self::FFDHE4096); } $ssl_settings .= 'ssl.dh-file = "' . $dhparams . '"' . "\n"; $ssl_settings .= 'ssl.ec-curve = "secp384r1"' . "\n"; diff --git a/lib/Froxlor/Cron/Http/Nginx.php b/lib/Froxlor/Cron/Http/Nginx.php index fe951784c7..ffe153ee6b 100644 --- a/lib/Froxlor/Cron/Http/Nginx.php +++ b/lib/Froxlor/Cron/Http/Nginx.php @@ -399,7 +399,7 @@ protected function composeSslSettings($domain_or_ip) if (!empty(Settings::Get('system.dhparams_file'))) { $dhparams = FileDir::makeCorrectFile(Settings::Get('system.dhparams_file')); if (!file_exists($dhparams)) { - FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096'); + file_put_contents($dhparams, self::FFDHE4096); } $sslsettings .= "\t" . 'ssl_dhparam ' . $dhparams . ';' . "\n"; }