@@ -4684,28 +4684,26 @@ $_authorizations_map"
46844684 thumbprint=" $( __calc_account_thumbprint) "
46854685 fi
46864686
4687+ keyauthorization=" "
4688+
4689+ if echo " $response " | grep ' "status":"valid"' > /dev/null 2>&1 ; then
4690+ _debug " $d is already valid."
4691+ keyauthorization=" $STATE_VERIFIED "
4692+ _debug keyauthorization " $keyauthorization "
4693+ fi
4694+
46874695 entry=" $( echo " $response " | _egrep_o ' [^\{]*"type":"' $vtype ' "[^\}]*' ) "
46884696 _debug entry " $entry "
4689- keyauthorization=" "
4690- if [ -z " $entry " ]; then
4691- if ! _startswith " $d " ' *.' ; then
4692- _debug " Not a wildcard domain, lets check whether the validation is already valid."
4693- if echo " $response " | grep ' "status":"valid"' > /dev/null 2>&1 ; then
4694- _debug " $d is already valid."
4695- keyauthorization=" $STATE_VERIFIED "
4696- _debug keyauthorization " $keyauthorization "
4697- fi
4698- fi
4699- if [ -z " $keyauthorization " ]; then
4700- _err " Error, can not get domain token entry $d for $vtype "
4701- _supported_vtypes=" $( echo " $response " | _egrep_o " \" challenges\" :\[[^]]*]" | tr ' {' " \n" | grep type | cut -d ' "' -f 4 | tr " \n" ' ' ) "
4702- if [ " $_supported_vtypes " ]; then
4703- _err " The supported validation types are: $_supported_vtypes , but you specified: $vtype "
4704- fi
4705- _clearup
4706- _on_issue_err " $_post_hook "
4707- return 1
4697+
4698+ if [ -z " $keyauthorization " -a -z " $entry " ]; then
4699+ _err " Error, can not get domain token entry $d for $vtype "
4700+ _supported_vtypes=" $( echo " $response " | _egrep_o " \" challenges\" :\[[^]]*]" | tr ' {' " \n" | grep type | cut -d ' "' -f 4 | tr " \n" ' ' ) "
4701+ if [ " $_supported_vtypes " ]; then
4702+ _err " The supported validation types are: $_supported_vtypes , but you specified: $vtype "
47084703 fi
4704+ _clearup
4705+ _on_issue_err " $_post_hook "
4706+ return 1
47094707 fi
47104708
47114709 if [ -z " $keyauthorization " ]; then
@@ -4731,12 +4729,6 @@ $_authorizations_map"
47314729 fi
47324730 keyauthorization=" $token .$thumbprint "
47334731 _debug keyauthorization " $keyauthorization "
4734-
4735- if printf " %s" " $response " | grep ' "status":"valid"' > /dev/null 2>&1 ; then
4736- _debug " $d is already verified."
4737- keyauthorization=" $STATE_VERIFIED "
4738- _debug keyauthorization " $keyauthorization "
4739- fi
47404732 fi
47414733
47424734 dvlist=" $d$sep$keyauthorization$sep$uri$sep$vtype$sep$_currentRoot "
0 commit comments