Skip to content

Commit 5d019bf

Browse files
author
Marius Burkard
committed
- added new webroot map argument to cli call of certbot on versions >= 0.31, should fix #5258
1 parent 6dfe36d commit 5d019bf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

server/lib/classes/letsencrypt.inc.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,17 @@ public function request_certificates($data, $server_type = 'apache') {
284284
} else {
285285
$acme_version = 'https://acme-v01.api.letsencrypt.org/directory';
286286
}
287-
$letsencrypt_cmd = $letsencrypt . " certonly -n --text --agree-tos --expand --authenticator webroot --server $acme_version --rsa-key-size 4096 --email postmaster@$domain $cli_domain_arg --webroot-path /usr/local/ispconfig/interface/acme";
287+
if ($letsencrypt_version >= 0.31) {
288+
$webroot_map = array();
289+
for($i = 0; $i < count($temp_domains); $i++) {
290+
$webroot_map[$temp_domains[$i]] = '/usr/local/ispconfig/interface/acme';
291+
}
292+
$webroot_args = "--webroot-map " . escapeshellarg(str_replace(array("\r", "\n"), '', json_encode($webroot_map)));
293+
} else {
294+
$webroot_args = "$cli_domain_arg --webroot-path /usr/local/ispconfig/interface/acme";
295+
}
296+
297+
$letsencrypt_cmd = $letsencrypt . " certonly -n --text --agree-tos --expand --authenticator webroot --server $acme_version --rsa-key-size 4096 --email postmaster@$domain $webroot_args";
288298
$success = $app->system->_exec($letsencrypt_cmd);
289299
}
290300
} else {

0 commit comments

Comments
 (0)