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

@ -43,9 +43,7 @@ class ServerContextFactory(ContextFactory):
logger.exception("Failed to enable elliptic curve for TLS")
context.set_options(SSL.OP_NO_SSLv2 | SSL.OP_NO_SSLv3)
context.use_certificate_chain_file(config.tls_certificate_file)
if not config.no_tls:
context.use_privatekey(config.tls_private_key)
context.use_privatekey(config.tls_private_key)
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
context.set_cipher_list(