Tweak definition of self-signed cert to cover cases where issuer is not the current main domain anymore

This commit is contained in:
Alexandre Aubin 2021-12-01 18:37:59 +01:00
parent 9488b419c3
commit 8feb63be0c

View file

@ -664,6 +664,8 @@ def _prepare_certificate_signing_request(domain, key_file, output_folder):
def _get_status(domain): def _get_status(domain):
import yunohost.domain
cert_file = os.path.join(CERT_FOLDER, domain, "crt.pem") cert_file = os.path.join(CERT_FOLDER, domain, "crt.pem")
if not os.path.isfile(cert_file): if not os.path.isfile(cert_file):
@ -692,7 +694,7 @@ def _get_status(domain):
) )
days_remaining = (valid_up_to - datetime.utcnow()).days 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 = { CA_type = {
"code": "self-signed", "code": "self-signed",
"verbose": "Self-signed", "verbose": "Self-signed",