From 926dd27fefed30bc68020ec7fcf1d1bcbb9c6d69 Mon Sep 17 00:00:00 2001 From: siddharth Date: Sat, 29 May 2021 11:25:54 -0400 Subject: acmens.py: update `sign_csr` Add handling to update account; currently just updates the `contact` to the email provided on the command line. --- acmens.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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": []} -- cgit v1.2.3