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
45e386b2
Commit
45e386b2
authored
Mar 08, 2018
by
neilpang
Browse files
fix
https://github.com/Neilpang/acme.sh/issues/1336
parent
e1db5db8
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
45e386b2
...
...
@@ -63,6 +63,7 @@ END_CSR="-----END CERTIFICATE REQUEST-----"
BEGIN_CERT
=
"-----BEGIN CERTIFICATE-----"
END_CERT
=
"-----END CERTIFICATE-----"
CONTENT_TYPE_JSON
=
"application/jose+json"
RENEW_SKIP
=
2
ECC_SEP
=
"_"
...
...
@@ -1591,12 +1592,13 @@ _inithttp() {
}
# body url [needbase64] [POST|PUT]
# body url [needbase64] [POST|PUT]
[ContentType]
_post
()
{
body
=
"
$1
"
_post_url
=
"
$2
"
needbase64
=
"
$3
"
httpmethod
=
"
$4
"
_postContentType
=
"
$5
"
if
[
-z
"
$httpmethod
"
]
;
then
httpmethod
=
"POST"
...
...
@@ -1612,6 +1614,9 @@ _post() {
if
[
"
$HTTPS_INSECURE
"
]
;
then
_CURL
=
"
$_CURL
--insecure "
fi
if
[
"
$_postContentType
"
]
;
then
_CURL
=
"
$_CURL
-H
\"
Content-Type:
$_postContentType
\"
"
fi
_debug
"_CURL"
"
$_CURL
"
if
[
"
$needbase64
"
]
;
then
response
=
"
$(
$_CURL
--user-agent
"
$USER_AGENT
"
-X
$httpmethod
-H
"
$_H1
"
-H
"
$_H2
"
-H
"
$_H3
"
-H
"
$_H4
"
-H
"
$_H5
"
--data
"
$body
"
"
$_post_url
"
| _base64
)
"
...
...
@@ -1631,6 +1636,9 @@ _post() {
if
[
"
$HTTPS_INSECURE
"
]
;
then
_WGET
=
"
$_WGET
--no-check-certificate "
fi
if
[
"
$_postContentType
"
]
;
then
_WGET
=
"
$_WGET
--header
\"
Content-Type:
$_postContentType
\"
"
fi
_debug
"_WGET"
"
$_WGET
"
if
[
"
$needbase64
"
]
;
then
if
[
"
$httpmethod
"
=
"POST"
]
;
then
...
...
@@ -1765,7 +1773,7 @@ _send_signed_request() {
if
[
"
$ACME_NEW_NONCE
"
]
;
then
_debug2
"Get nonce. ACME_NEW_NONCE"
"
$ACME_NEW_NONCE
"
nonceurl
=
"
$ACME_NEW_NONCE
"
if
_post
""
"
$nonceurl
"
""
"HEAD"
;
then
if
_post
""
"
$nonceurl
"
""
"HEAD"
"
$CONTENT_TYPE_JSON
"
;
then
_headers
=
"
$(
cat
"
$HTTP_HEADER
"
)
"
fi
fi
...
...
@@ -1820,7 +1828,7 @@ _send_signed_request() {
fi
_debug3 body
"
$body
"
response
=
"
$(
_post
"
$body
"
"
$url
"
"
$needbase64
"
)
"
response
=
"
$(
_post
"
$body
"
"
$url
"
"
$needbase64
"
"POST"
"
$CONTENT_TYPE_JSON
"
)
"
_CACHED_NONCE
=
""
if
[
"
$?
"
!=
"0"
]
;
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