-
- dialback_requests[attr.from.."/"..origin.streamid] = origin;
-
- local compat_check;
- if not origin.from_host then
- -- Just used for friendlier logging
- origin.from_host = nameprep(attr.from);
- if not origin.from_host then
- origin.log("debug", "We need to know where to connect but remote server blindly refuses to tell us and to comply to specs, closing connection.");
- origin:close("invalid-from");
+
+ if dwd and 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;