From f70e8aff9290e2d390fb799ea08c50ecb86d730d Mon Sep 17 00:00:00 2001 From: Mathias Schiller Date: Sun, 6 Dec 2015 11:49:51 +0100 Subject: fix for corrupt chain on mobil device (e.g. safari on ipad) --- src/server/plugins-available/apache2_plugin.inc.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/server/plugins-available') diff --git a/src/server/plugins-available/apache2_plugin.inc.php b/src/server/plugins-available/apache2_plugin.inc.php index 66486b8..2ba7efe 100755 --- a/src/server/plugins-available/apache2_plugin.inc.php +++ b/src/server/plugins-available/apache2_plugin.inc.php @@ -961,8 +961,9 @@ class apache2_plugin { $lddomain .= (string) " --domains www." . $domain; } - $crt_tmp_file = "/etc/letsencrypt/live/".$domain."/fullchain.pem"; + $crt_tmp_file = "/etc/letsencrypt/live/".$domain."/cert.pem"; $key_tmp_file = "/etc/letsencrypt/live/".$domain."/privkey.pem"; + $bundle_tmp_file = "/etc/letsencrypt/live/".$domain."/chain.pem"; $webroot = $data['new']['document_root']."/web"; //* check if we have already a Let's Encrypt cert @@ -1013,6 +1014,18 @@ class apache2_plugin { exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file)); } + if(is_file($bundle_file)) { + $app->system->copy($bundle_file, $bundle_file.'.old.'.$date); + $app->system->chmod($bundle_file.'.old.'.$date, 0400); + $app->system->unlink($bundle_file); + } + + if($web_config["website_symlinks_rel"] == 'y') { + $this->create_relative_link(escapeshellcmd($bundle_tmp_file), escapeshellcmd($bundle_file)); + } else { + exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($crt_file)); + } + /* we don't need to store it. /* Update the DB of the (local) Server */ $app->db->query("UPDATE web_domain SET ssl_request = '', ssl_cert = '$ssl_cert', ssl_key = '$ssl_key' WHERE domain = '".$data['new']['domain']."'"); -- cgit v1.2.3