Skip to content

Commit f78f1e5

Browse files
author
Marius Cramer
committed
- certificate bundle is deprecated since apache 2.4.8
1 parent 178258f commit f78f1e5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

server/conf/vhost.conf.master

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.crt
5656
SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.key
5757
<tmpl_if name='has_bundle_cert'>
58-
SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.bundle
58+
<tmpl_if name='apache_version' op='<' value='2.4.8' format='version'>
59+
SSLCertificateChainFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.bundle
60+
</tmpl_if>
5961
</tmpl_if>
6062
</tmpl_if>
6163
</IfModule>

server/plugins-available/apache2_plugin.inc.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,15 @@ function ssl($event_name, $data) {
335335

336336
//* Write new ssl files
337337
if(trim($data["new"]["ssl_request"]) != '') $app->system->file_put_contents($csr_file, $data["new"]["ssl_request"]);
338-
if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]);
339-
if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]);
338+
if(version_compare($app->system->getapacheversion(true), '2.4.8', '>=')) {
339+
$tmp_data = '';
340+
if(trim($data["new"]["ssl_cert"]) != '') $tmp_data .= $data["new"]["ssl_cert"] . "\n";
341+
if(trim($data["new"]["ssl_bundle"]) != '') $tmp_data .= $data["new"]["ssl_bundle"];
342+
if(trim($tmp_data) != '') $app->system->file_put_contents($crt_file, $tmp_data);
343+
} else {
344+
if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]);
345+
if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]);
346+
}
340347

341348
//* Write the key file, if field is empty then import the key into the db
342349
if(trim($data["new"]["ssl_key"]) != '') {

0 commit comments

Comments
 (0)