Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
3afa4b21
Commit
3afa4b21
authored
Oct 27, 2016
by
neilpang
Browse files
add retry for temp authz request error
parent
998783eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
3afa4b21
...
@@ -2282,11 +2282,27 @@ issue() {
...
@@ -2282,11 +2282,27 @@ issue() {
_info
"Getting new-authz for domain"
$d
_info
"Getting new-authz for domain"
$d
if
!
_send_signed_request
"
$API
/acme/new-authz"
"{
\"
resource
\"
:
\"
new-authz
\"
,
\"
identifier
\"
: {
\"
type
\"
:
\"
dns
\"
,
\"
value
\"
:
\"
$(
_idn
"
$d
"
)
\"
}}"
;
then
_Max_new_authz_retry_times
=
5
_err
"Can not get domain token."
_authz_i
=
0
_clearup
while
[
"
$_authz_i
"
-lt
"
$_Max_new_authz_retry_times
"
]
;
do
_on_issue_err
_info
"Try new-authz for the
$_authz_i
time."
return
1
if
!
_send_signed_request
"
$API
/acme/new-authz"
"{
\"
resource
\"
:
\"
new-authz
\"
,
\"
identifier
\"
: {
\"
type
\"
:
\"
dns
\"
,
\"
value
\"
:
\"
$(
_idn
"
$d
"
)
\"
}}"
;
then
_err
"Can not get domain token."
_clearup
_on_issue_err
return
1
fi
if
!
_contains
"
$response
"
"An error occurred while processing your request"
;
then
_info
"The new-authz request is ok."
break
fi
_authz_i
=
"
$(
_math
"
$_authz_i
"
+ 1
)
"
_info
"Sleep
$_authz_i
to retry."
_sleep
"
$_authz_i
"
done
;
if
[
"
$_authz_i
"
=
"
$_Max_new_authz_retry_times
"
]
;
then
_debug
"new-authz retry reach the max
$_Max_new_authz_retry_times
times."
fi
fi
if
[
!
-z
"
$code
"
]
&&
[
!
"
$code
"
=
'201'
]
;
then
if
[
!
-z
"
$code
"
]
&&
[
!
"
$code
"
=
'201'
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment