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
f8dac590
Commit
f8dac590
authored
Feb 03, 2024
by
neil
Browse files
check the status of Order object and the Authorization object.
parent
1905830b
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
f8dac590
...
@@ -4515,7 +4515,7 @@ issue() {
...
@@ -4515,7 +4515,7 @@ issue() {
vlist
=
"
$Le_Vlist
"
vlist
=
"
$Le_Vlist
"
_cleardomainconf
"Le_Vlist"
_cleardomainconf
"Le_Vlist"
_
info
"Getting domain auth token for each domain"
_
debug
"Getting domain auth token for each domain"
sep
=
'#'
sep
=
'#'
dvsep
=
','
dvsep
=
','
if
[
-z
"
$vlist
"
]
;
then
if
[
-z
"
$vlist
"
]
;
then
...
@@ -4571,12 +4571,22 @@ issue() {
...
@@ -4571,12 +4571,22 @@ issue() {
if
[
"
$_notAfter
"
]
;
then
if
[
"
$_notAfter
"
]
;
then
_newOrderObj
=
"
$_newOrderObj
,
\"
notAfter
\"
:
\"
$_notAfter
\"
"
_newOrderObj
=
"
$_newOrderObj
,
\"
notAfter
\"
:
\"
$_notAfter
\"
"
fi
fi
_debug
"STEP 1, Ordering a Certificate"
if
!
_send_signed_request
"
$ACME_NEW_ORDER
"
"
$_newOrderObj
}"
;
then
if
!
_send_signed_request
"
$ACME_NEW_ORDER
"
"
$_newOrderObj
}"
;
then
_err
"Create new order error."
_err
"Create new order error."
_clearup
_clearup
_on_issue_err
"
$_post_hook
"
_on_issue_err
"
$_post_hook
"
return
1
return
1
fi
fi
if
_contains
"
$response
"
"invalid"
;
then
if
echo
"
$response
"
| _normalizeJson |
grep
'"status":"invalid"'
>
/dev/null 2>&1
;
then
_err
"Create new order with invalid status."
_err
"
$response
"
_clearup
_on_issue_err
"
$_post_hook
"
return
1
fi
fi
Le_LinkOrder
=
"
$(
echo
"
$responseHeaders
"
|
grep
-i
'^Location.*$'
| _tail_n 1 |
tr
-d
"
\r\n
"
|
cut
-d
":"
-f
2-
)
"
Le_LinkOrder
=
"
$(
echo
"
$responseHeaders
"
|
grep
-i
'^Location.*$'
| _tail_n 1 |
tr
-d
"
\r\n
"
|
cut
-d
":"
-f
2-
)
"
_debug Le_LinkOrder
"
$Le_LinkOrder
"
_debug Le_LinkOrder
"
$Le_LinkOrder
"
...
@@ -4601,6 +4611,7 @@ issue() {
...
@@ -4601,6 +4611,7 @@ issue() {
return
1
return
1
fi
fi
_debug
"STEP 2, Get the authorizations of each domain"
#domain and authz map
#domain and authz map
_authorizations_map
=
""
_authorizations_map
=
""
for
_authz_url
in
$(
echo
"
$_authorizations_seg
"
|
tr
','
' '
)
;
do
for
_authz_url
in
$(
echo
"
$_authorizations_seg
"
|
tr
','
' '
)
;
do
...
@@ -4609,6 +4620,7 @@ issue() {
...
@@ -4609,6 +4620,7 @@ issue() {
_err
"get to authz error."
_err
"get to authz error."
_err
"_authorizations_seg"
"
$_authorizations_seg
"
_err
"_authorizations_seg"
"
$_authorizations_seg
"
_err
"_authz_url"
"
$_authz_url
"
_err
"_authz_url"
"
$_authz_url
"
_err
"
$response
"
_clearup
_clearup
_on_issue_err
"
$_post_hook
"
_on_issue_err
"
$_post_hook
"
return
1
return
1
...
@@ -4616,6 +4628,14 @@ issue() {
...
@@ -4616,6 +4628,14 @@ issue() {
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
_debug2 response
"
$response
"
_debug2 response
"
$response
"
if
echo
"
$response
"
|
grep
'"status":"invalid"'
>
/dev/null 2>&1
;
then
_err
"get authz objec with invalid status, please try again later."
_err
"_authorizations_seg"
"
$_authorizations_seg
"
_err
"
$response
"
_clearup
_on_issue_err
"
$_post_hook
"
return
1
fi
_d
=
"
$(
echo
"
$response
"
| _egrep_o
'"value" *: *"[^"]*"'
|
cut
-d
:
-f
2- |
tr
-d
' "'
)
"
_d
=
"
$(
echo
"
$response
"
| _egrep_o
'"value" *: *"[^"]*"'
|
cut
-d
:
-f
2- |
tr
-d
' "'
)
"
if
_contains
"
$response
"
"
\"
wildcard
\"
*: *true"
;
then
if
_contains
"
$response
"
"
\"
wildcard
\"
*: *true"
;
then
_d
=
"*.
$_d
"
_d
=
"*.
$_d
"
...
...
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