# HG changeset patch # User Kim Alvefur # Date 1404507896 -7200 # Node ID d289582d351887a8f952b2312a85de9aa0f0323e # Parent 76699a0ae4c402ce24beee16221425f347a13eee mod_dialback.lua: Only check certificates on secure connections diff -r 76699a0ae4c4 -r d289582d3518 plugins/mod_dialback.lua --- a/plugins/mod_dialback.lua Fri Jul 04 22:52:34 2014 +0200 +++ b/plugins/mod_dialback.lua Fri Jul 04 23:04:56 2014 +0200 @@ -82,12 +82,14 @@ 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