Skip to content

Commit bc58de7

Browse files
author
Till Brehm
committed
Fixed: #4359 SSL Bundle certificates can not be saved
1 parent 72c5229 commit bc58de7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,13 @@ function ssl($event_name, $data) {
415415
//* Write new ssl files
416416
if(trim($data["new"]["ssl_request"]) != '') $app->system->file_put_contents($csr_file, $data["new"]["ssl_request"]);
417417
if(version_compare($app->system->getapacheversion(true), '2.4.8', '>=')) {
418+
// In apache 2.4.8 and newer, the ssl crt file contains the bundle, so we need no separate bundle file
418419
$tmp_data = '';
419420
if(trim($data["new"]["ssl_cert"]) != '') $tmp_data .= $data["new"]["ssl_cert"] . "\n";
420-
if(trim($data["new"]["ssl_bundle"]) != '') {
421-
$tmp_data .= $data["new"]["ssl_bundle"];
422-
$app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]);
423-
}
421+
if(trim($data["new"]["ssl_bundle"]) != '') $tmp_data .= $data["new"]["ssl_bundle"];
424422
if(trim($tmp_data) != '') $app->system->file_put_contents($crt_file, $tmp_data);
425423
} else {
424+
// Write separate crt and bundle file
426425
if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]);
427426
if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]);
428427
}

0 commit comments

Comments
 (0)