summary refs log tree commit diff
path: root/synapse/app/_base.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-01-30 11:00:02 +0000
committerGitHub <noreply@github.com>2019-01-30 11:00:02 +0000
commitf6813919e8bc8245e5353700bfd4bef338ecbce6 (patch)
treea39eaceec2c2fc03a307582d08c151367c50fc36 /synapse/app/_base.py
parentAdd a caching layer to .well-known responses (#4516) (diff)
downloadsynapse-f6813919e8bc8245e5353700bfd4bef338ecbce6.tar.xz
SIGHUP for TLS cert reloading (#4495)
Diffstat (limited to 'synapse/app/_base.py')
-rw-r--r--synapse/app/_base.py29
1 files changed, 22 insertions, 7 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py
index 18584226e9..3840c663ab 100644
--- a/synapse/app/_base.py
+++ b/synapse/app/_base.py
@@ -143,6 +143,9 @@ def listen_metrics(bind_addresses, port):
 def listen_tcp(bind_addresses, port, factory, reactor=reactor, backlog=50):
     """
     Create a TCP socket for a port and several addresses
+
+    Returns:
+        list (empty)
     """
     for address in bind_addresses:
         try:
@@ -155,25 +158,37 @@ def listen_tcp(bind_addresses, port, factory, reactor=reactor, backlog=50):
         except error.CannotListenError as e:
             check_bind_error(e, address, bind_addresses)
 
+    logger.info("Synapse now listening on TCP port %d", port)
+    return []
+
 
 def listen_ssl(
     bind_addresses, port, factory, context_factory, reactor=reactor, backlog=50
 ):
     """
-    Create an SSL socket for a port and several addresses
+    Create an TLS-over-TCP socket for a port and several addresses
+
+    Returns:
+        list of twisted.internet.tcp.Port listening for TLS connections
     """
+    r = []
     for address in bind_addresses:
         try:
-            reactor.listenSSL(
-                port,
-                factory,
-                context_factory,
-                backlog,
-                address
+            r.append(
+                reactor.listenSSL(
+                    port,
+                    factory,
+                    context_factory,
+                    backlog,
+                    address
+                )
             )
         except error.CannotListenError as e:
             check_bind_error(e, address, bind_addresses)
 
+    logger.info("Synapse now listening on port %d (TLS)", port)
+    return r
+
 
 def check_bind_error(e, address, bind_addresses):
     """