aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-07-04 23:04:56 +0200
committerKim Alvefur <zash@zash.se>2014-07-04 23:04:56 +0200
commit260fc78e4095f1e4ed74d4e76dc1eb23713bacf1 (patch)
tree09cbb8eaa27b5b0335c60af7a88ec4d7e0e4c9ed
parentf56c435f182f95f0c1149083634a62b6e52a09c1 (diff)
downloadprosody-260fc78e4095f1e4ed74d4e76dc1eb23713bacf1.tar.gz
prosody-260fc78e4095f1e4ed74d4e76dc1eb23713bacf1.zip
mod_dialback.lua: Only check certificates on secure connections
-rw-r--r--plugins/mod_dialback.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua
index fa6b6dbc..15e24281 100644
--- a/plugins/mod_dialback.lua
+++ b/plugins/mod_dialback.lua
@@ -82,12 +82,14 @@ module:hook("stanza/jabber:server:dialback:result", function(event)
local attr = stanza.attr;
local to, from = nameprep(attr.to), nameprep(attr.from);
- if check_cert_status(origin, from) == false then
- return
- elseif origin.cert_chain_status == "valid" and origin.cert_identity_status == "valid" then
- origin.sends2s(st.stanza("db:result", { to = from, from = to, id = attr.id, type = "valid" }));
- module:fire_event("s2s-authenticated", { session = origin, host = from });
- return true;
+ if origin.secure then
+ if check_cert_status(origin, from) == false then
+ return
+ elseif origin.cert_chain_status == "valid" and origin.cert_identity_status == "valid" then
+ origin.sends2s(st.stanza("db:result", { to = from, from = to, id = attr.id, type = "valid" }));
+ module:fire_event("s2s-authenticated", { session = origin, host = from });
+ return true;
+ end
end
if not hosts[to] then