summaryrefslogtreecommitdiffstats
path: root/acmens.py
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-05-29 11:25:54 -0400
committersiddharth <s@ricketyspace.net>2021-05-29 11:25:54 -0400
commit926dd27fefed30bc68020ec7fcf1d1bcbb9c6d69 (patch)
tree561feb9e31cdad8ed024e0852e66b4270ed470d4 /acmens.py
parent74d7f0733490f743d0609bdc3af2d785d9714dbd (diff)
acmens.py: update `sign_csr`
Add handling to update account; currently just updates the `contact` to the email provided on the command line.
Diffstat (limited to 'acmens.py')
-rw-r--r--acmens.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/acmens.py b/acmens.py
index 58a13d0..ba21563 100644
--- a/acmens.py
+++ b/acmens.py
@@ -12,7 +12,7 @@ from urllib.request import urlopen
from urllib.error import HTTPError
-__version__ = "0.1.4-dev1"
+__version__ = "0.1.4-dev2"
CA_PRD = "https://acme-v02.api.letsencrypt.org"
CA_STG = "https://acme-staging-v02.api.letsencrypt.org"
@@ -330,6 +330,17 @@ def sign_csr(ca_url, account_key, csr, email=None, challenge_type="http"):
sys.stderr.write("Already registered!\n")
auth = {"kid": acct_headers["Location"]}
+ sys.stderr.write("Updating account...")
+ ua_result, ua_code, ua_headers = _send_signed_request(
+ acct_headers["Location"],
+ {"contact": ["mailto:{}".format(email)]},
+ nonce_url,
+ auth,
+ account_key,
+ "Error updating account",
+ )
+ sys.stderr.write("Done\n")
+
# Step 5: Request challenges for domains
sys.stderr.write("Making new order for {0}...\n".format(", ".join(domains)))
id = {"identifiers": []}