From f78f1e5d4e837b658b535d90c28c3a55df8e8a91 Mon Sep 17 00:00:00 2001 From: Marius Cramer Date: Thu, 9 Oct 2014 18:22:36 +0200 Subject: [PATCH] - certificate bundle is deprecated since apache 2.4.8 --- server/conf/vhost.conf.master | 4 +++- server/plugins-available/apache2_plugin.inc.php | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 008c8774b..a65f1d277 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -55,7 +55,9 @@ SSLCertificateFile /ssl/.crt SSLCertificateKeyFile /ssl/.key - SSLCACertificateFile /ssl/.bundle + + SSLCertificateChainFile /ssl/.bundle + diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index f1a08af39..6e6ac114f 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -335,8 +335,15 @@ class apache2_plugin { //* Write new ssl files if(trim($data["new"]["ssl_request"]) != '') $app->system->file_put_contents($csr_file, $data["new"]["ssl_request"]); - if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]); - if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]); + if(version_compare($app->system->getapacheversion(true), '2.4.8', '>=')) { + $tmp_data = ''; + if(trim($data["new"]["ssl_cert"]) != '') $tmp_data .= $data["new"]["ssl_cert"] . "\n"; + if(trim($data["new"]["ssl_bundle"]) != '') $tmp_data .= $data["new"]["ssl_bundle"]; + if(trim($tmp_data) != '') $app->system->file_put_contents($crt_file, $tmp_data); + } else { + if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]); + if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]); + } //* Write the key file, if field is empty then import the key into the db if(trim($data["new"]["ssl_key"]) != '') { -- GitLab