53 end |
53 end |
54 end |
54 end |
55 end); |
55 end); |
56 |
56 |
57 module:add_event_hook("s2s-stream-features", |
57 module:add_event_hook("s2s-stream-features", |
58 function (session, features) |
58 function (session, features) |
59 if session.conn.starttls then |
59 -- This hook is possibly called once per host (at least if the |
60 --features:tag("starttls", starttls_attr):up(); |
60 -- remote server does not specify a to/from. |
|
61 if session.conn.starttls and not features:child_with_ns(xmlns_starttls) then |
|
62 features:tag("starttls", starttls_attr); |
|
63 -- TODO: Make this optional :P |
|
64 --features:tag("required"):up():up(); |
61 end |
65 end |
62 end); |
66 end); |
63 |
67 |
64 -- For s2sout connections, start TLS if we can |
68 -- For s2sout connections, start TLS if we can |
65 module:hook_stanza(xmlns_stream, "features", |
69 module:hook_stanza(xmlns_stream, "features", |