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
c420a0ae
Unverified
Commit
c420a0ae
authored
Apr 26, 2019
by
neil
Committed by
GitHub
Apr 26, 2019
Browse files
Merge pull request #2222 from dim0x69/master
Implement Update Account Information for ACMEv2
parents
a85e50f4
79e2f8a2
Changes
1
Show whitespace changes
Inline
Side-by-side
acme.sh
View file @
c420a0ae
...
@@ -3238,11 +3238,6 @@ _on_issue_success() {
...
@@ -3238,11 +3238,6 @@ _on_issue_success() {
}
}
updateaccount() {
_initpath
_regAccount
}
registeraccount() {
registeraccount() {
_reg_length="$1"
_reg_length="$1"
_initpath
_initpath
...
@@ -3340,6 +3335,61 @@ _regAccount() {
...
@@ -3340,6 +3335,61 @@ _regAccount() {
_info "ACCOUNT_THUMBPRINT" "$ACCOUNT_THUMBPRINT"
_info "ACCOUNT_THUMBPRINT" "$ACCOUNT_THUMBPRINT"
}
}
#implement updateaccount
updateaccount() {
_initpath
if [ ! -f "$ACCOUNT_KEY_PATH" ] && [ -f "$_OLD_ACCOUNT_KEY" ]; then
_info "mv $_OLD_ACCOUNT_KEY to $ACCOUNT_KEY_PATH"
mv "$_OLD_ACCOUNT_KEY" "$ACCOUNT_KEY_PATH"
fi
if [ ! -f "$ACCOUNT_JSON_PATH" ] && [ -f "$_OLD_ACCOUNT_JSON" ]; then
_info "mv $_OLD_ACCOUNT_JSON to $ACCOUNT_JSON_PATH"
mv "$_OLD_ACCOUNT_JSON" "$ACCOUNT_JSON_PATH"
fi
if [ ! -f "$ACCOUNT_KEY_PATH" ]; then
_err "Account key is not found at: $ACCOUNT_KEY_PATH"
return 1
fi
_accUri=$(_readcaconf "ACCOUNT_URL")
_debug _accUri "$_accUri"
if [ -z "$_accUri" ]; then
_err "The account url is empty, please run '--update-account' first to update the account info first,"
_err "Then try again."
return 1
fi
if ! _calcjwk "$ACCOUNT_KEY_PATH"; then
return 1
fi
_initAPI
if [ "$ACME_VERSION" = "2" ]; then
if [ "$ACCOUNT_EMAIL" ]; then
updjson='{"contact": ["mailto: '$ACCOUNT_EMAIL'"]}'
fi
else
# ACMEv1: Updates happen the same way a registration is done.
# https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-6.3
_regAccount
return
fi
# this part handles ACMEv2 account updates.
_send_signed_request "$_accUri" "$updjson"
if [ "$code" = '200' ]; then
_info "account update success for $_accUri."
else
_info "Error. The account was not updated."
return 1
fi
}
#Implement deactivate account
#Implement deactivate account
deactivateaccount() {
deactivateaccount() {
_initpath
_initpath
...
...
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