From d952a081c76f4e4002784379214eddde4a8c13ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Wed, 11 Sep 2019 19:58:39 +0200 Subject: [PATCH] Improve error 400 details updating LE challenge In a string like: { "type": "urn:ietf:params:acme:error:malformed", "detail": "Unable to update challenge :: authorization must be pending", "status": 400 } It picks the value for "details". So the user will have more info about the let's encrypt error and not only a 400 blind error --- bin/v-add-letsencrypt-domain | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/v-add-letsencrypt-domain b/bin/v-add-letsencrypt-domain index 6a12af87f..1e320d4cf 100755 --- a/bin/v-add-letsencrypt-domain +++ b/bin/v-add-letsencrypt-domain @@ -200,8 +200,9 @@ for auth in $authz; do validation=$(echo "$answer"|grep -A1 $proto |tail -n1|cut -f4 -d \") nonce=$(echo "$answer" |grep Nonce |cut -f2 -d \ |tr -d '\r\n') status=$(echo "$answer"|grep HTTP/1.1 |tail -n1 |cut -f 2 -d ' ') + details=$(echo "$answer"| grep detail | cut -f 2 -d ',' | cut -f 2-4 -d ':') if [[ "$status" -ne 200 ]]; then - check_result $E_CONNECT "Let's Encrypt validation status $status" + check_result $E_CONNECT "Let's Encrypt validation status $status. Details: $details" fi i=$((i + 1))