From 74dced9b005f9e4882f5bcc407f8f43c98eb811a Mon Sep 17 00:00:00 2001 From: selfhoster1312 Date: Fri, 10 May 2024 18:02:40 +0200 Subject: [PATCH] Add _cert_exists to check if certificate is already generated --- src/certificate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/certificate.py b/src/certificate.py index f76876290..a510f0d31 100644 --- a/src/certificate.py +++ b/src/certificate.py @@ -627,6 +627,9 @@ def _prepare_certificate_signing_request(domain, key_file, output_folder): with open(csr_file, "wb") as f: f.write(crypto.dump_certificate_request(crypto.FILETYPE_PEM, csr)) +def _cert_exists(domain): bool + cert_file = os.path.join(CERT_FOLDER, domain, "crt.pem") + return os.path.isfile(cert_file) def _get_status(domain): cert_file = os.path.join(CERT_FOLDER, domain, "crt.pem")