mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-25 06:31:42 +00:00
add the new reg hash
This commit is contained in:
parent
30684246d2
commit
f574e5813f
20
acme.sh
20
acme.sh
@ -1401,19 +1401,19 @@ issue() {
|
|||||||
accountkey_json=$(echo -n "$jwk" | tr -d ' ' )
|
accountkey_json=$(echo -n "$jwk" | tr -d ' ' )
|
||||||
thumbprint=$(echo -n "$accountkey_json" | _digest "sha256" | _urlencode)
|
thumbprint=$(echo -n "$accountkey_json" | _digest "sha256" | _urlencode)
|
||||||
|
|
||||||
accountkeyhash="$(cat "$ACCOUNT_KEY_PATH" | _digest "sha256" )"
|
regjson='{"resource": "new-reg", "agreement": "'$AGREEMENT'"}'
|
||||||
accountkeyhash="$(echo $accountkeyhash$API | _digest "sha256" )"
|
if [ "$ACCOUNT_EMAIL" ] ; then
|
||||||
if [ "$accountkeyhash" != "$ACCOUNT_KEY_HASH" ] ; then
|
regjson='{"resource": "new-reg", "contact": ["mailto: '$ACCOUNT_EMAIL'"], "agreement": "'$AGREEMENT'"}'
|
||||||
_info "Registering account"
|
fi
|
||||||
regjson='{"resource": "new-reg", "agreement": "'$AGREEMENT'"}'
|
|
||||||
if [ "$ACCOUNT_EMAIL" ] ; then
|
|
||||||
regjson='{"resource": "new-reg", "contact": ["mailto: '$ACCOUNT_EMAIL'"], "agreement": "'$AGREEMENT'"}'
|
|
||||||
fi
|
|
||||||
_send_signed_request "$API/acme/new-reg" "$regjson"
|
|
||||||
|
|
||||||
|
accountkeyhash="$(cat "$ACCOUNT_KEY_PATH" | _digest "sha256" )"
|
||||||
|
accountkeyhash="$(echo $accountkeyhash$API$regjson | _digest "sha256" )"
|
||||||
|
if [ "$accountkeyhash" != "$ACCOUNT_KEY_HASH" ] ; then
|
||||||
|
_info "Registering account"
|
||||||
|
_send_signed_request "$API/acme/new-reg" "$regjson"
|
||||||
if [ "$code" = "" ] || [ "$code" = '201' ] ; then
|
if [ "$code" = "" ] || [ "$code" = '201' ] ; then
|
||||||
_info "Registered"
|
_info "Registered"
|
||||||
echo $response > $LE_WORKING_DIR/account.json
|
echo "$response" > $LE_WORKING_DIR/account.json
|
||||||
elif [ "$code" = '409' ] ; then
|
elif [ "$code" = '409' ] ; then
|
||||||
_info "Already registered"
|
_info "Already registered"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user