summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-02-11 17:57:58 +0000
committerRichard van der Hoff <richard@matrix.org>2019-02-11 21:39:14 +0000
commit4fddf8fc77496d9bb3b5fa8835f0e5ba9a5a9926 (patch)
tree642076f830711fb2e967799b136cb92030e2026b /synapse/app
parentMerge branch 'rav/no_create_server_contexts_if_no_tls' into rav/tls_cert/work (diff)
downloadsynapse-4fddf8fc77496d9bb3b5fa8835f0e5ba9a5a9926.tar.xz
Infer no_tls from presence of TLS listeners
Rather than have to specify `no_tls` explicitly, infer whether we need to load
the TLS keys etc from whether we have any TLS-enabled listeners.
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/_base.py2
-rwxr-xr-xsynapse/app/homeserver.py5
2 files changed, 1 insertions, 6 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py
index 6b3cb61ae9..50fd17c0be 100644
--- a/synapse/app/_base.py
+++ b/synapse/app/_base.py
@@ -215,7 +215,7 @@ def refresh_certificate(hs):
     """
     hs.config.read_certificate_from_disk()
 
-    if hs.config.no_tls:
+    if not hs.config.has_tls_listener():
         # nothing else to do here
         return
 
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index b4476bf16e..dbd98d394f 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -90,11 +90,6 @@ class SynapseHomeServer(HomeServer):
         tls = listener_config.get("tls", False)
         site_tag = listener_config.get("tag", port)
 
-        if tls and config.no_tls:
-            raise ConfigError(
-                "Listener on port %i has TLS enabled, but no_tls is set" % (port,),
-            )
-
         resources = {}
         for res in listener_config["resources"]:
             for name in res["names"]: