mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
fix tests
This commit is contained in:
parent
4fddf8fc77
commit
0ca2908653
@ -111,7 +111,7 @@ class TlsConfig(Config):
|
||||
"""
|
||||
self.tls_certificate = self.read_tls_certificate()
|
||||
|
||||
if not self.no_tls:
|
||||
if self.has_tls_listener():
|
||||
self.tls_private_key = self.read_tls_private_key()
|
||||
|
||||
self.tls_fingerprints = list(self._original_tls_fingerprints)
|
||||
|
@ -20,6 +20,11 @@ from synapse.config.tls import TlsConfig
|
||||
from tests.unittest import TestCase
|
||||
|
||||
|
||||
class TestConfig(TlsConfig):
|
||||
def has_tls_listener(self):
|
||||
return False
|
||||
|
||||
|
||||
class TLSConfigTests(TestCase):
|
||||
|
||||
def test_warn_self_signed(self):
|
||||
@ -55,11 +60,10 @@ s4niecZKPBizL6aucT59CsunNmmb5Glq8rlAcU+1ZTZZzGYqVYhF6axB9Qg=
|
||||
|
||||
config = {
|
||||
"tls_certificate_path": os.path.join(config_dir, "cert.pem"),
|
||||
"no_tls": True,
|
||||
"tls_fingerprints": []
|
||||
}
|
||||
|
||||
t = TlsConfig()
|
||||
t = TestConfig()
|
||||
t.read_config(config)
|
||||
t.read_certificate_from_disk()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user