Skip to content

Commit a052c5c

Browse files
committed
Improve error reporting LE
1 parent 773db54 commit a052c5c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ for auth in $authz; do
386386
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
387387
details=$(echo "$answer"| grep detail | cut -f 1 -d ',' | cut -f 2-4 -d ':' | cut -f 2 -d '"')
388388

389-
debug_log "Step 5" "- status: ${status}\n- nonce: ${nonce}\n- validation: ${validation}\n- details: ${details}\n- answer: ${answer}"
389+
debug_log "Step 5" "- status: ${status}\n- url: ${url}\n- nonce: ${nonce}\n- validation: ${validation}\n- details: ${details}\n- answer: ${answer}"
390390

391391
if [[ "$status" -ne 200 ]]; then
392392
# Delete DNS CAA record
@@ -400,8 +400,14 @@ for auth in $authz; do
400400
fi
401401
fi
402402
fi
403-
debug_log "Abort Step 5" "=> Wrong status"
404-
check_result "$E_CONNECT" "Let's Encrypt validation status $status ($domain). Details: $details"
403+
# Download debug info from LE server
404+
result=$(wget -qO- $url)
405+
debug_log "Debug information Step 5" "$result"
406+
details=$(echo $result | jq '.error.detail' )
407+
error_code=$(echo $result | jq '.error.status' )
408+
409+
debug_log "Abort Step 5" "=> Wrong status"
410+
check_result "$E_CONNECT" "Let's Encrypt validation status $status ($domain). Details: $error_code:$details"
405411
fi
406412

407413
i=$((i + 1))

0 commit comments

Comments
 (0)