Skip to content

Commit a7f17fc

Browse files
committed
Add --cert-name option to certbot calls to set primary domain instead of --expand
Fixes https://git.ispconfig.org/ispconfig/ispconfig3/-/issues/6061
1 parent d0d5415 commit a7f17fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/lib/classes/letsencrypt.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public function get_certbot_command($domains) {
137137
return false;
138138
}
139139

140+
$primary_domain = $domains[0];
140141
$matches = array();
141142
$ret = null;
142143
$val = 0;
@@ -158,11 +159,13 @@ public function get_certbot_command($domains) {
158159
$webroot_map[$domains[$i]] = '/usr/local/ispconfig/interface/acme';
159160
}
160161
$webroot_args = "--webroot-map " . escapeshellarg(str_replace(array("\r", "\n"), '', json_encode($webroot_map)));
162+
$cert_selection_command = "--cert-name $primary_domain";
161163
} else {
162164
$webroot_args = "$cmd --webroot-path /usr/local/ispconfig/interface/acme";
165+
$cert_selection_command = "--expand";
163166
}
164167

165-
$cmd = $letsencrypt . " certonly -n --text --agree-tos --expand --authenticator webroot --server $acme_version --rsa-key-size 4096 --email postmaster@$domain $webroot_args";
168+
$cmd = $letsencrypt . " certonly -n --text --agree-tos $cert_selection_command --authenticator webroot --server $acme_version --rsa-key-size 4096 --email postmaster@$primary_domain $webroot_args";
166169

167170
return $cmd;
168171
}

0 commit comments

Comments
 (0)