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:
Sunil Mohan Adapa committed 2019-02-13 19:34:04 -08:00
1 parent b169739867
commit e448ab6380
2 files changed
+35 -11

No files matched your search

+2 -7
View File
@@ -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')