From a53946a8a185490c6569d9a7dc6ffc07c344e74a Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 1 Sep 2014 18:30:00 +0100 Subject: Enable SSL for s2s http client --- synapse/http/client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'synapse/http') 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: -- cgit 1.5.1 From 5452a8ee2990658b5582c74bb96e7624085f0b9b Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 1 Sep 2014 18:43:08 +0100 Subject: Fix SSL for federation http client --- synapse/http/client.py | 2 +- synapse/http/endpoint.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'synapse/http') diff --git a/synapse/http/client.py b/synapse/http/client.py index acc39742de..093bdf0e3f 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -180,7 +180,7 @@ class TwistedHttpClient(HttpClient): # TODO: setup and pass in an ssl_context to enable TLS endpoint = matrix_endpoint( reactor, destination, timeout=10, - ssl_context_factory=self.hs.tls_tls_context_factory + ssl_context_factory=self.hs.tls_context_factory ) while True: diff --git a/synapse/http/endpoint.py b/synapse/http/endpoint.py index d91500b07d..a6ebe23567 100644 --- a/synapse/http/endpoint.py +++ b/synapse/http/endpoint.py @@ -53,7 +53,7 @@ def matrix_endpoint(reactor, destination, ssl_context_factory=None, default_port = 8080 else: transport_endpoint = SSL4ClientEndpoint - endpoint_kw_args.update(ssl_context_factory=ssl_context_factory) + endpoint_kw_args.update(sslContextFactory=ssl_context_factory) default_port = 443 if port is None: -- cgit 1.5.1