local send = session.sends2s;
-- TODO: #29: SASL/TLS on s2s streams
- session.version = 0; --tonumber(attr.version) or 0;
+ session.version = tonumber(attr.version) or 0;
if session.version >= 1.0 and not (attr.to and attr.from) then
log("warn", (session.to_host or "(unknown)").." failed to specify 'to' or 'from' hostname as per RFC");
-- If server is pre-1.0, don't wait for features, just do dialback
if session.version < 1.0 then
if not session.dialback_verifying then
+ log("debug", "Initiating dialback...");
initiate_dialback(session);
else
mark_connected(session);
end);
module:add_event_hook("s2s-stream-features",
- function (session, features)
- if session.conn.starttls then
- --features:tag("starttls", starttls_attr):up();
+ function (session, features)
+ -- This hook is possibly called once per host (at least if the
+ -- remote server does not specify a to/from.
+ if session.conn.starttls and not features:child_with_ns(xmlns_starttls) then
+ features:tag("starttls", starttls_attr);
+ -- TODO: Make this optional :P
+ --features:tag("required"):up():up();
end
end);
end
net_activate_ports("c2s", "xmppclient", {5222}, (global_ssl_ctx and "tls") or "tcp");
- net_activate_ports("s2s", "xmppserver", {5269}, "tcp");
+ net_activate_ports("s2s", "xmppserver", {5269}, (global_ssl_ctx and "tls") or "tcp");
net_activate_ports("component", "xmppcomponent", {}, "tcp");
net_activate_ports("legacy_ssl", "xmppclient", {}, "ssl");
net_activate_ports("console", "console", {5582}, "tcp");