summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-04-02 10:57:18 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2019-04-02 10:57:18 +0100
commitfec0c9a0745f5c3ebaad98f8b1788c5b74a93bef (patch)
treef3d801b41725066d8626317adede0ae62568fb58
parentDon't run validation code if validation is turned off (diff)
downloadsynapse-fec0c9a0745f5c3ebaad98f8b1788c5b74a93bef.tar.xz
Remove TODO
-rw-r--r--synapse/crypto/context_factory.py1
-rw-r--r--tests/http/federation/test_matrix_federation_agent.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/synapse/crypto/context_factory.py b/synapse/crypto/context_factory.py
index 97c796a047..0035846de0 100644
--- a/synapse/crypto/context_factory.py
+++ b/synapse/crypto/context_factory.py
@@ -146,6 +146,7 @@ class ClientTLSOptionsFactory(object):
 
         # Check if certificate verification has been enabled
         if (self._config.federation_verify_certificates and
+                self._config.federation_certificate_validation_whitelist and
                 host not in self._config.federation_certificate_validation_whitelist):
             # Require verification
             return ClientTLSOptions(host, self._options_validate._makeContext())
diff --git a/tests/http/federation/test_matrix_federation_agent.py b/tests/http/federation/test_matrix_federation_agent.py
index 2ca91635a9..dcf184d3cf 100644
--- a/tests/http/federation/test_matrix_federation_agent.py
+++ b/tests/http/federation/test_matrix_federation_agent.py
@@ -53,7 +53,7 @@ class MatrixFederationAgentTests(TestCase):
 
         self.agent = MatrixFederationAgent(
             reactor=self.reactor,
-            tls_client_options_factory=ClientTLSOptionsFactory(#TODO How to deal with None config in tests???),
+            tls_client_options_factory=ClientTLSOptionsFactory(None),
             _well_known_tls_policy=TrustingTLSPolicyForHTTPS(),
             _srv_resolver=self.mock_resolver,
             _well_known_cache=self.well_known_cache,