mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
matrixsynapse: Better checking for valid certificate
If a valid certificate is available but not yet setup, the earlier code assumes there is a valid certificate. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
2 files changed
+35
-11
No files matched your search
@@ -164,10 +164,5 @@ def get_public_registration_status():
|
||||
|
||||
def has_valid_certificate():
|
||||
"""Return whether the configured domain name has a valid certificate."""
|
||||
domain_name = get_configured_domain_name()
|
||||
status = actions.superuser_run('letsencrypt', ['get-status'])
|
||||
status = json.loads(status)
|
||||
if domain_name in status['domains']:
|
||||
return status['domains'][domain_name]['certificate_available']
|
||||
|
||||
return False
|
||||
status = actions.superuser_run('matrixsynapse', ['letsencrypt', 'get-status'])
|
||||
return status.startswith('valid')
|
||||
Reference in new issue
Block a user