-
- dialback_requests[attr.from.."/"..origin.streamid] = origin;
-
- if not origin.from_host then
- -- Just used for friendlier logging
- origin.from_host = nameprep(attr.from);
- -- COMPAT: Fix ejabberd chopness by resetting the send function
- 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");
- else
- origin.log("debug", "Remote server didn't specify a from attr, resetting session.send now that we know where to knock to.");
- origin.send = function(stanza) hosts[attr.to].events.fire_event("route/remote", { from_host = origin.to_host, to_host = origin.from_host, stanza = stanza}); end
+
+ 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;