From 2abd16d51c1d30c7e6e479f757f5f8c8e07e0bf6 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Sat, 15 Jun 2024 16:41:34 +0000 Subject: [PATCH] Fix in --lax-cert-check --- src/Content/ContentManager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index c1461150..bf9411e6 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -540,8 +540,10 @@ class ContentManager: # to prevent spam, if cert is compromised, only allow personal rules if config.lax_cert_check or cert_addresses is None or self.isGoodCert(cert_addresses[0]): permission_rules = user_contents.get('permission_rules', {}).items() - if not self.isGoodCert(cert_addresses[0]): - self.log.warning('Accepting compromised certificate! This may lead to spam attack. Turn off with --no_lax_cert_check. Default behaviour may change in the future.') + if cert_addresses is None: + self.log.warning('Accepting no certificate because you have --lax-cert-check on.') + elif not self.isGoodCert(cert_addresses[0]): + self.log.warning('Accepting compromised certificate! This may lead to spam attack. Turn off with --no-lax-cert-check. Default behaviour may change in the future.') else: permission_rules = {} for permission_pattern, permission_rules in permission_rules: # Regexp rules