Skip to content

Commit ec5ecab

Browse files
authored
Merge pull request #5008 from cjwalsh/patch-1
Fix for empty error objects in response breaking extraction of domain validation types
2 parents 8cac773 + e391301 commit ec5ecab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

acme.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4762,7 +4762,8 @@ $_authorizations_map"
47624762
_debug keyauthorization "$keyauthorization"
47634763
fi
47644764

4765-
entry="$(echo "$response" | _egrep_o '[^\{]*"type":"'$vtype'"[^\}]*')"
4765+
# Fix for empty error objects in response which mess up the original code, adapted from fix suggested here: https://github.com/acmesh-official/acme.sh/issues/4933#issuecomment-1870499018
4766+
entry="$(echo "$response" | sed s/'"error":{}'/'"error":null'/ | _egrep_o '[^\{]*"type":"'$vtype'"[^\}]*')"
47664767
_debug entry "$entry"
47674768

47684769
if [ -z "$keyauthorization" -a -z "$entry" ]; then
@@ -6351,7 +6352,8 @@ _deactivate() {
63516352
fi
63526353
_debug "Trigger validation."
63536354
vtype="$(_getIdType "$_d_domain")"
6354-
entry="$(echo "$response" | _egrep_o '[^\{]*"type":"'$vtype'"[^\}]*')"
6355+
# Fix for empty error objects in response which mess up the original code, adapted from fix suggested here: https://github.com/acmesh-official/acme.sh/issues/4933#issuecomment-1870499018
6356+
entry="$(echo "$response" | sed s/'"error":{}'/'"error":null'/ | _egrep_o '[^\{]*"type":"'$vtype'"[^\}]*')"
63556357
_debug entry "$entry"
63566358
if [ -z "$entry" ]; then
63576359
_err "$d: Cannot get domain token"

0 commit comments

Comments
 (0)