Skip to content

Commit 50306f0

Browse files
author
Marius Burkard
committed
- fixed ssl disabling on letsencrypt and added aliasdomain (Fixes: #3779)
1 parent 96f31df commit 50306f0

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,14 +1119,7 @@ function update($event_name, $data) {
11191119
}
11201120
*/
11211121

1122-
//* Generate Let's Encrypt SSL certificat
1123-
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1124-
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1125-
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1126-
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1127-
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1128-
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on aliasdomain
1129-
)) {
1122+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') {
11301123
if(substr($domain, 0, 2) === '*.') {
11311124
// wildcard domain not yet supported by letsencrypt!
11321125
$app->log('Wildcard domains not yet supported by letsencrypt, so changing ' . $domain . ' to ' . substr($domain, 2), LOGLEVEL_WARN);
@@ -1135,7 +1128,16 @@ function update($event_name, $data) {
11351128

11361129
$data['new']['ssl_domain'] = $domain;
11371130
$vhost_data['ssl_domain'] = $domain;
1131+
}
11381132

1133+
//* Generate Let's Encrypt SSL certificat
1134+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1135+
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1136+
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1137+
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1138+
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1139+
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on aliasdomain
1140+
)) {
11391141
// default values
11401142
$temp_domains = array();
11411143
$lddomain = $domain;

server/plugins-available/nginx_plugin.inc.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,15 +1232,7 @@ function update($event_name, $data) {
12321232

12331233
$tpl->setVar('ssl_letsencrypt', "n");
12341234

1235-
//* Generate Let's Encrypt SSL certificat
1236-
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1237-
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1238-
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1239-
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1240-
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1241-
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on alias domain
1242-
)) {
1243-
1235+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') {
12441236
//* be sure to have good domain
12451237
if(substr($domain, 0, 2) === '*.') {
12461238
// wildcard domain not yet supported by letsencrypt!
@@ -1250,7 +1242,16 @@ function update($event_name, $data) {
12501242

12511243
$data['new']['ssl_domain'] = $domain;
12521244
$vhost_data['ssl_domain'] = $domain;
1253-
1245+
}
1246+
1247+
//* Generate Let's Encrypt SSL certificat
1248+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1249+
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1250+
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1251+
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1252+
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1253+
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on alias domain
1254+
)) {
12541255
// default values
12551256
$temp_domains = array();
12561257
$lddomain = $domain;

0 commit comments

Comments
 (0)