Remove redundant code to reload tls cert (#10054)

we don't need to reload the tls cert if we don't have any tls listeners.

Follow-up to #9280.
This commit is contained in:
Richard van der Hoff 2021-05-27 10:34:24 +01:00 committed by GitHub
parent 224f2f949b
commit fe5dad46b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 25 deletions

View file

@ -261,13 +261,10 @@ 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.
"""
if not hs.config.has_tls_listener():
# 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.config.read_certificate_from_disk()
hs.tls_server_context_factory = context_factory.ServerContextFactory(hs.config)
if hs._listening_services: