aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_tls.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-01-26 19:47:33 +0100
committerKim Alvefur <zash@zash.se>2017-01-26 19:47:33 +0100
commit7e1a61f76b04981306d02759f4a8c07c8af9ea86 (patch)
treed70f10039b1ee0bdec5f010014db2fd1fe0b7b83 /plugins/mod_tls.lua
parenta845ca47015583bf7b41f20362fd210c037639f3 (diff)
parente18117b8f9bffb05582ff610f0bd011d54a94c33 (diff)
downloadprosody-7e1a61f76b04981306d02759f4a8c07c8af9ea86.tar.gz
prosody-7e1a61f76b04981306d02759f4a8c07c8af9ea86.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_tls.lua')
-rw-r--r--plugins/mod_tls.lua10
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