equal
deleted
inserted
replaced
54 features:up(); |
54 features:up(); |
55 end |
55 end |
56 end |
56 end |
57 end); |
57 end); |
58 |
58 |
59 module:add_event_hook("s2s-stream-features", |
59 module:hook("s2s-stream-features", |
60 function (session, features) |
60 function (data) |
61 -- This hook is possibly called once per host (at least if the |
61 local session, features = data.session, data.features; |
62 -- remote server does not specify a to/from. |
62 if session.to_host and session.conn.starttls then |
63 if session.to_host and session.conn.starttls and not features:child_with_ns(xmlns_starttls) then |
|
64 features:tag("starttls", starttls_attr):up(); |
63 features:tag("starttls", starttls_attr):up(); |
65 if secure_s2s_only then |
64 if secure_s2s_only then |
66 features:tag("required"):up():up(); |
65 features:tag("required"):up():up(); |
67 else |
66 else |
68 features:up(); |
67 features:up(); |