Browse Source

When retrying DNS_ADD, delete first

pull/593/head
Tim Kimber 5 years ago
parent
commit
c6b75847a4
No known key found for this signature in database GPG Key ID: 3E1804964E76BD18
2 changed files with 6 additions and 5 deletions
  1. +5
    -4
      getssl
  2. +1
    -1
      test/test-config/getssl-staging-dns01.cfg

+ 5
- 4
getssl View File

@ -916,7 +916,7 @@ create_order() {
d=$(echo "$d" | tr "[:upper:]" "[:lower:]")
if [ "$d" == "$authdomain" ]; then
debug "Saving authorization response for $authdomain for domain alldomains[$dn]"
debug "Response = ${response//['\t\r\n']}"
debug "Response = ${response//[$'\t\r\n']}"
AuthLinkResponse[$dn]=$response
AuthLinkResponseHeader[$dn]=$responseHeaders
fi
@ -1049,7 +1049,7 @@ for d in $alldomains; do
uri=$(json_get "$response" "uri" "dns-01")
debug uri "$uri"
else # APIv2
debug "authlink response = ${response//['\t\r\n']}"
debug "authlink response = ${response//[$'\t\r\n']}"
# get the token and uri from the dns-01 component
token=$(json_get "$response" "challenges" "type" "dns-01" "token")
uri=$(json_get "$response" "challenges" "type" "dns-01" "url")
@ -1105,7 +1105,7 @@ for d in $alldomains; do
uri=$(json_get "$response" "uri" "http-01")
debug uri "$uri"
else # APIv2
debug "authlink response = ${response//['\t\r\n']}"
debug "authlink response = ${response//[$'\t\r\n']}"
# get the token from the http-01 component
token=$(json_get "$response" "challenges" "type" "http-01" "token")
# get the uri from the http component
@ -1224,8 +1224,9 @@ if [[ $VALIDATE_VIA_DNS == "true" ]]; then
if [[ $ntries -lt $DNS_WAIT_COUNT ]]; then
ntries=$(( ntries + 1 ))
if [[ $DNS_WAIT_RETRY_ADD == "true" && $(( ntries % 10 == 0 )) ]]; then
if [[ $DNS_WAIT_RETRY_ADD == "true" && $(( ntries % 10 )) == 0 ]]; then
debug "Retrying adding dns via command: $DNS_ADD_COMMAND $lower_d $auth_key"
eval "$DNS_DEL_COMMAND" "$lower_d" "$auth_key"
if ! eval "$DNS_ADD_COMMAND" "$lower_d" "$auth_key" ; then
error_exit "DNS_ADD_COMMAND failed for domain $d"
fi


+ 1
- 1
test/test-config/getssl-staging-dns01.cfg View File

@ -5,7 +5,7 @@ CA="https://acme-staging-v02.api.letsencrypt.org/directory"
VALIDATE_VIA_DNS=true
DNS_ADD_COMMAND="/getssl/dns_scripts/dns_add_duckdns"
DNS_DEL_COMMAND="/getssl/dns_scripts/dns_del_duckdns"
PUBLIC_DNS_SERVER=ns2.duckdns.org
PUBLIC_DNS_SERVER=1.1.1.1
CHECK_ALL_AUTH_DNS="false"
DNS_EXTRA_WAIT=120


Loading…
Cancel
Save