mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 14:56:42 -04:00
Fix error when loading cert if tls is disabled (#4618)
If TLS is disabled, it should not be an error if no cert is given. Fixes #4554.
This commit is contained in:
parent
46b8a79b3a
commit
32b781bfe2
4 changed files with 47 additions and 18 deletions
|
@ -213,12 +213,13 @@ def refresh_certificate(hs):
|
|||
Refresh the TLS certificates that Synapse is using by re-reading them from
|
||||
disk and updating the TLS context factories to use them.
|
||||
"""
|
||||
hs.config.read_certificate_from_disk()
|
||||
|
||||
if not hs.config.has_tls_listener():
|
||||
# nothing else to do here
|
||||
# attempt to reload the certs for the good of the tls_fingerprints
|
||||
hs.config.read_certificate_from_disk(require_cert_and_key=False)
|
||||
return
|
||||
|
||||
hs.config.read_certificate_from_disk(require_cert_and_key=True)
|
||||
hs.tls_server_context_factory = context_factory.ServerContextFactory(hs.config)
|
||||
|
||||
if hs._listening_services:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue