diff options
Diffstat (limited to 'src/server/plugins-available')
-rwxr-xr-x | src/server/plugins-available/apache2_plugin.inc.php | 15 |
1 files changed, 14 insertions, 1 deletions
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']."'"); |