diff options
author | Kim Alvefur <zash@zash.se> | 2017-01-26 19:47:33 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-01-26 19:47:33 +0100 |
commit | 4c6a84a00ef37846e432ba76e3771087d23cceb1 (patch) | |
tree | d70f10039b1ee0bdec5f010014db2fd1fe0b7b83 /plugins/mod_tls.lua | |
parent | 0c22ed35793dc8b751dea8c89e418986efd8aa08 (diff) | |
parent | a67d0bfb97f2c2e0b2cd7a303accd70c95911275 (diff) | |
download | prosody-4c6a84a00ef37846e432ba76e3771087d23cceb1.tar.gz prosody-4c6a84a00ef37846e432ba76e3771087d23cceb1.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_tls.lua')
-rw-r--r-- | plugins/mod_tls.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 5869b2a5..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; @@ -79,6 +79,10 @@ local function can_do_tls(session) else return false; end + if not session.ssl_ctx then + session.log("debug", "Should be able to do TLS but no context available"); + return false; + end return session.ssl_ctx; end |