Skip to content

Commit 605dae8

Browse files
authored
Merge pull request hestiacp#1037 from kmark/fix-letsenc-errors
Let's Encrypt fixes for hestiacp#979 (invalid response) and hestiacp#1008 (/tmp/*/domain.tld.crt file not found)
2 parents 753f1ae + d4a4bca commit 605dae8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bin/v-check-letsencrypt-domain

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,16 @@ uri=$(echo "$answer" |grep -A 3 http-01 |grep uri |cut -f 4 -d \")
8989
# Adding location wrapper for request challenge
9090
if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
9191
conf="$HOMEDIR/$user/conf/web/nginx.$r_domain.conf_letsencrypt"
92+
sconf="$HOMEDIR/$user/conf/web/snginx.$r_domain.conf_letsencrypt"
9293
if [ ! -e "$conf" ]; then
9394
echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' > $conf
9495
echo ' default_type text/plain;' >> $conf
9596
echo ' return 200 "$1.'$thumb'";' >> $conf
9697
echo '}' >> $conf
9798
fi
99+
if [ ! -e "$sconf" ]; then
100+
ln -s "$conf" "$sconf"
101+
fi
98102
else
99103
acme="$HOMEDIR/$user/web/$r_domain/public_html/.well-known/acme-challenge"
100104
if [ ! -d "$acme" ]; then

web/edit/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
}
280280

281281
// Change SSL certificate
282-
if (( $v_letsencrypt == 'no' ) && ( $v_ssl == 'yes' ) && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
282+
if (( $v_letsencrypt == 'no' ) && (empty($_POST['v_letsencrypt'])) && ( $v_ssl == 'yes' ) && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
283283
if (( $v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n", $_POST['v_ssl_ca']))) {
284284
exec ('mktemp -d', $mktemp_output, $return_var);
285285
$tmpdir = $mktemp_output[0];

0 commit comments

Comments
 (0)