47 if not origin.username and origin.conn.starttls then |
47 if not origin.username and origin.conn.starttls then |
48 features:add_child(c2s_feature); |
48 features:add_child(c2s_feature); |
49 end |
49 end |
50 end); |
50 end); |
51 module:hook("s2s-stream-features", function(event) |
51 module:hook("s2s-stream-features", function(event) |
52 local session, features = event.session, event.features; |
52 local origin, features = event.origin, event.features; |
53 if session.to_host and session.type ~= "s2sin" and session.conn.starttls then |
53 if origin.to_host and origin.type ~= "s2sin" and origin.conn.starttls then |
54 features:add_child(s2s_feature); |
54 features:add_child(s2s_feature); |
55 end |
55 end |
56 end); |
56 end); |
57 |
57 |
58 -- For s2sout connections, start TLS if we can |
58 -- For s2sout connections, start TLS if we can |