Don't create server contexts when TLS is disabled

we aren't going to use them anyway.
This commit is contained in:
Richard van der Hoff 2019-02-11 21:30:59 +00:00
parent 086f6f27d4
commit 9645728619
3 changed files with 7 additions and 3 deletions

View file

@ -214,6 +214,11 @@ def refresh_certificate(hs):
disk and updating the TLS context factories to use them.
"""
hs.config.read_certificate_from_disk()
if hs.config.no_tls:
# nothing else to do here
return
hs.tls_server_context_factory = context_factory.ServerContextFactory(hs.config)
if hs._listening_services: