From b3f172a68e83773d48e1133e3e1445d08f9469fe Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 25 Jan 2017 11:12:43 +0100 Subject: mod_tls: Return session.ssl_ctx if not nil, like when doing the full session type check --- plugins/mod_tls.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/mod_tls.lua') diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 678b4039..c5903b61 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -62,10 +62,10 @@ do end local function can_do_tls(session) - if session.ssl_ctx == false or not session.conn.starttls then + if session.ssl_ctx ~= nil then + return session.ssl_ctx; + elseif not session.conn.starttls then return false; - elseif session.ssl_ctx then - return true; end if session.type == "c2s_unauthed" then session.ssl_ctx = ssl_ctx_c2s; -- cgit v1.2.3