diff options
author | Erik Johnston <erik@matrix.org> | 2019-07-31 11:40:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-31 11:40:02 +0100 |
commit | 8fde611a8c099c7515e19212b2ccf67687b0fb00 (patch) | |
tree | e947c59a133dbed107f2ab2e6e144bc31c611a81 /synapse/crypto/context_factory.py | |
parent | Remove DelayedCall debugging from test runs (#5787) (diff) | |
parent | Newsfile (diff) | |
download | synapse-8fde611a8c099c7515e19212b2ccf67687b0fb00.tar.xz |
Merge pull request #5794 from matrix-org/erikj/share_ssl_options_for_well_known
Share SSL options for well-known requests
Diffstat (limited to 'synapse/crypto/context_factory.py')
-rw-r--r-- | synapse/crypto/context_factory.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/crypto/context_factory.py b/synapse/crypto/context_factory.py index 4f48e8e88d..06e63a96b5 100644 --- a/synapse/crypto/context_factory.py +++ b/synapse/crypto/context_factory.py @@ -31,6 +31,7 @@ from twisted.internet.ssl import ( platformTrust, ) from twisted.python.failure import Failure +from twisted.web.iweb import IPolicyForHTTPS logger = logging.getLogger(__name__) @@ -74,6 +75,7 @@ class ServerContextFactory(ContextFactory): return self._context +@implementer(IPolicyForHTTPS) class ClientTLSOptionsFactory(object): """Factory for Twisted SSLClientConnectionCreators that are used to make connections to remote servers for federation. @@ -146,6 +148,12 @@ class ClientTLSOptionsFactory(object): f = Failure() tls_protocol.failVerification(f) + def creatorForNetloc(self, hostname, port): + """Implements the IPolicyForHTTPS interace so that this can be passed + directly to agents. + """ + return self.get_options(hostname) + @implementer(IOpenSSLClientConnectionCreator) class SSLClientConnectionCreator(object): |