summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-09-01 18:30:00 +0100
committerMark Haines <mark.haines@matrix.org>2014-09-01 18:30:00 +0100
commita53946a8a185490c6569d9a7dc6ffc07c344e74a (patch)
tree7feacceace84fbb6390e4e7b7c3ba89b56380246 /synapse
parentAdd server TLS context factory (diff)
downloadsynapse-a53946a8a185490c6569d9a7dc6ffc07c344e74a.tar.xz
Enable SSL for s2s http client
Diffstat (limited to 'synapse')
-rwxr-xr-xsynapse/app/homeserver.py2
-rw-r--r--synapse/http/client.py8
2 files changed, 7 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 20c10bac66..44830e1325 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -62,7 +62,7 @@ SCHEMA_VERSION = 1
 class SynapseHomeServer(HomeServer):
 
     def build_http_client(self):
-        return TwistedHttpClient()
+        return TwistedHttpClient(self)
 
     def build_resource_for_client(self):
         return JsonResource()
diff --git a/synapse/http/client.py b/synapse/http/client.py
index 36ba2c6591..acc39742de 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -113,8 +113,9 @@ class TwistedHttpClient(HttpClient):
             requests.
     """
 
-    def __init__(self):
+    def __init__(self, hs):
         self.agent = MatrixHttpAgent(reactor)
+        self.hs = hs
 
     @defer.inlineCallbacks
     def put_json(self, destination, path, data):
@@ -177,7 +178,10 @@ class TwistedHttpClient(HttpClient):
         retries_left = 5
 
         # TODO: setup and pass in an ssl_context to enable TLS
-        endpoint = matrix_endpoint(reactor, destination, timeout=10)
+        endpoint = matrix_endpoint(
+            reactor, destination, timeout=10,
+            ssl_context_factory=self.hs.tls_tls_context_factory
+        )
 
         while True:
             try: