From 8feb63be0c93ffd881d9863764d7cee417792672 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 1 Dec 2021 18:37:59 +0100 Subject: [PATCH] Tweak definition of self-signed cert to cover cases where issuer is not the current main domain anymore --- src/certificate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/certificate.py b/src/certificate.py index 86a63a996..c89d2e312 100644 --- a/src/certificate.py +++ b/src/certificate.py @@ -664,6 +664,8 @@ def _prepare_certificate_signing_request(domain, key_file, output_folder): def _get_status(domain): + import yunohost.domain + cert_file = os.path.join(CERT_FOLDER, domain, "crt.pem") if not os.path.isfile(cert_file): @@ -692,7 +694,7 @@ def _get_status(domain): ) days_remaining = (valid_up_to - datetime.utcnow()).days - if cert_issuer == "yunohost.org" or cert_issuer == _name_self_CA(): + if cert_issuer in ["yunohost.org"] + yunohost.domain.domain_list()["domains"]: CA_type = { "code": "self-signed", "verbose": "Self-signed",