diff options
author | Glyph <glyph@twistedmatrix.com> | 2016-12-11 01:46:43 -0800 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2016-12-11 11:10:32 +0100 |
commit | 9f07f4c5595b0eff19c9740c44803700b01b14af (patch) | |
tree | 08f80bdcfb230f320f9fbdf7917926320e4bb416 /synapse | |
parent | IPv6 support for client.py (diff) | |
download | synapse-9f07f4c5595b0eff19c9740c44803700b01b14af.tar.xz |
IPv6 support for endpoint.py
Similar to https://github.com/matrix-org/synapse/pull/1689, but for endpoint.py
Diffstat (limited to '')
-rw-r--r-- | synapse/http/endpoint.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/http/endpoint.py b/synapse/http/endpoint.py index 442696d393..5e2e428dbf 100644 --- a/synapse/http/endpoint.py +++ b/synapse/http/endpoint.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from twisted.internet.endpoints import SSL4ClientEndpoint, TCP4ClientEndpoint +from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS from twisted.internet import defer from twisted.internet.error import ConnectError from twisted.names import client, dns @@ -58,11 +58,11 @@ def matrix_federation_endpoint(reactor, destination, ssl_context_factory=None, endpoint_kw_args.update(timeout=timeout) if ssl_context_factory is None: - transport_endpoint = TCP4ClientEndpoint + transport_endpoint = HostnameEndpoint default_port = 8008 else: - transport_endpoint = SSL4ClientEndpoint - endpoint_kw_args.update(sslContextFactory=ssl_context_factory) + def transport_endpoint(reactor, host, port): + return wrapClientTLS(ssl_context_factory, HostnameEndpoint(reactor, host, port)) default_port = 8448 if port is None: |