Mercurial > prosody-hg
diff plugins/mod_tls.lua @ 7868:11fcdef5022f
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 26 Jan 2017 19:47:33 +0100 |
| parents | 7ece186a44d3 |
| children | eb5fba4c8074 |
line wrap: on
line diff
--- a/plugins/mod_tls.lua Tue Jan 24 21:24:03 2017 +0100 +++ b/plugins/mod_tls.lua Thu Jan 26 19:47:33 2017 +0100 @@ -62,10 +62,10 @@ 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 @@ 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
