mirror of
https://github.com/diafygi/acme-tiny
synced 2026-10-07 10:01:56 +03:00
pointed out by @felixfontein in #222, we shouldn't delete the challenge files on errors, but we should clean them up on success
This commit is contained in:
+1
-1
@@ -140,7 +140,6 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA, disable_check
|
||||
wellknown_url = "http://{0}/.well-known/acme-challenge/{1}".format(domain, token)
|
||||
assert (disable_check or _do_request(wellknown_url)[0] == keyauthorization)
|
||||
except (AssertionError, ValueError) as e:
|
||||
os.remove(wellknown_path)
|
||||
raise ValueError("Wrote file to {0}, but couldn't download {1}: {2}".format(wellknown_path, wellknown_url, e))
|
||||
|
||||
# say the challenge is done
|
||||
@@ -148,6 +147,7 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA, disable_check
|
||||
authorization = _poll_until_not(auth_url, ["pending"], "Error checking challenge status for {0}".format(domain))
|
||||
if authorization['status'] != "valid":
|
||||
raise ValueError("Challenge did not pass for {0}: {1}".format(domain, authorization))
|
||||
os.remove(wellknown_path)
|
||||
log.info("{0} verified!".format(domain))
|
||||
|
||||
# finalize the order with the csr
|
||||
|
||||
Reference in New Issue
Block a user