From 50306f0211e83560169a0f09fad1db3423befb62 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Mon, 29 Feb 2016 20:24:40 +0100 Subject: [PATCH] - fixed ssl disabling on letsencrypt and added aliasdomain (Fixes: #3779) --- .../plugins-available/apache2_plugin.inc.php | 18 +++++++++------- server/plugins-available/nginx_plugin.inc.php | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index b076ca9c2c..a8377f5f01 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -1119,14 +1119,7 @@ class apache2_plugin { } */ - //* Generate Let's Encrypt SSL certificat - if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active - ($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration - || ($data['old']['domain'] != $data['new']['domain']) // we have domain update - || ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain - || ($data['new']['type'] == 'subdomain') // we have new or update on subdomain - || ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on aliasdomain - )) { + if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') { if(substr($domain, 0, 2) === '*.') { // wildcard domain not yet supported by letsencrypt! $app->log('Wildcard domains not yet supported by letsencrypt, so changing ' . $domain . ' to ' . substr($domain, 2), LOGLEVEL_WARN); @@ -1135,7 +1128,16 @@ class apache2_plugin { $data['new']['ssl_domain'] = $domain; $vhost_data['ssl_domain'] = $domain; + } + //* Generate Let's Encrypt SSL certificat + if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active + ($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration + || ($data['old']['domain'] != $data['new']['domain']) // we have domain update + || ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain + || ($data['new']['type'] == 'subdomain') // we have new or update on subdomain + || ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on aliasdomain + )) { // default values $temp_domains = array(); $lddomain = $domain; diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index b50d4eb474..b3276e4c25 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1232,15 +1232,7 @@ class nginx_plugin { $tpl->setVar('ssl_letsencrypt', "n"); - //* Generate Let's Encrypt SSL certificat - if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active - ($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration - || ($data['old']['domain'] != $data['new']['domain']) // we have domain update - || ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain - || ($data['new']['type'] == 'subdomain') // we have new or update on subdomain - || ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on alias domain - )) { - + if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') { //* be sure to have good domain if(substr($domain, 0, 2) === '*.') { // wildcard domain not yet supported by letsencrypt! @@ -1250,7 +1242,16 @@ class nginx_plugin { $data['new']['ssl_domain'] = $domain; $vhost_data['ssl_domain'] = $domain; - + } + + //* Generate Let's Encrypt SSL certificat + if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active + ($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration + || ($data['old']['domain'] != $data['new']['domain']) // we have domain update + || ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain + || ($data['new']['type'] == 'subdomain') // we have new or update on subdomain + || ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on alias domain + )) { // default values $temp_domains = array(); $lddomain = $domain; -- GitLab