mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-21 12:14:29 +03:00
Give tests config with default config values
This commit is contained in:
parent
aeffa4d84a
commit
821baa4e7b
2 changed files with 6 additions and 2 deletions
|
@ -149,7 +149,6 @@ class ClientTLSOptionsFactory(object):
|
||||||
|
|
||||||
# Check if certificate verification has been enabled
|
# Check if certificate verification has been enabled
|
||||||
if (self._config.federation_verify_certificates and
|
if (self._config.federation_verify_certificates and
|
||||||
self._config.federation_certificate_validation_whitelist and
|
|
||||||
host not in self._config.federation_certificate_validation_whitelist):
|
host not in self._config.federation_certificate_validation_whitelist):
|
||||||
# Require verification
|
# Require verification
|
||||||
return ClientTLSOptions(host, self._options_validate._makeContext())
|
return ClientTLSOptions(host, self._options_validate._makeContext())
|
||||||
|
|
|
@ -49,11 +49,16 @@ class MatrixFederationAgentTests(TestCase):
|
||||||
|
|
||||||
self.mock_resolver = Mock()
|
self.mock_resolver = Mock()
|
||||||
|
|
||||||
|
config = Mock()
|
||||||
|
config.federation_custom_ca_list = None
|
||||||
|
config.federation_verify_certificates = False
|
||||||
|
config.federation_certificate_validation_whitelist = []
|
||||||
|
|
||||||
self.well_known_cache = TTLCache("test_cache", timer=self.reactor.seconds)
|
self.well_known_cache = TTLCache("test_cache", timer=self.reactor.seconds)
|
||||||
|
|
||||||
self.agent = MatrixFederationAgent(
|
self.agent = MatrixFederationAgent(
|
||||||
reactor=self.reactor,
|
reactor=self.reactor,
|
||||||
tls_client_options_factory=ClientTLSOptionsFactory(None),
|
tls_client_options_factory=ClientTLSOptionsFactory(config),
|
||||||
_well_known_tls_policy=TrustingTLSPolicyForHTTPS(),
|
_well_known_tls_policy=TrustingTLSPolicyForHTTPS(),
|
||||||
_srv_resolver=self.mock_resolver,
|
_srv_resolver=self.mock_resolver,
|
||||||
_well_known_cache=self.well_known_cache,
|
_well_known_cache=self.well_known_cache,
|
||||||
|
|
Loading…
Reference in a new issue