Chain tls_level and ssl_version only if ssl is enabled
If the tls_level is set to a cipherset other than tls_compat, the ssl cipherset has to get specified extra, if ssl is used. But if the user explicitly disabled SSL, and set tls_level to anything else than tls_compat required the user to explicitly set ssl_version, which is contradicting. Signed-off-by: Benedikt Heine <bebe@bebehei.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
d3ba837900
commit
ce9a1981c1
@ -100,7 +100,9 @@ class IMAPServer(object):
|
||||
self.sslversion = repos.getsslversion()
|
||||
self.starttls = repos.getstarttls()
|
||||
|
||||
if self.tlslevel is not "tls_compat" and self.sslversion is None:
|
||||
if self.usessl \
|
||||
and self.tlslevel is not "tls_compat" \
|
||||
and self.sslversion is None:
|
||||
raise Exception("When 'tls_level' is not 'tls_compat' "
|
||||
"the 'ssl_version' must be set explicitly.")
|
||||
|
||||
|
Reference in New Issue
Block a user