plugins/mod_tls.lua

changeset 1913
da49a59dff7c
parent 1912
126401a7159f
child 1926
e1c5b537f240
equal deleted inserted replaced
1912:126401a7159f 1913:da49a59dff7c
10 10
11 local xmlns_stream = 'http://etherx.jabber.org/streams'; 11 local xmlns_stream = 'http://etherx.jabber.org/streams';
12 local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls'; 12 local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls';
13 13
14 local secure_auth_only = module:get_option("c2s_require_encryption") or module:get_option("require_encryption"); 14 local secure_auth_only = module:get_option("c2s_require_encryption") or module:get_option("require_encryption");
15 local secure_s2s_only = module:get_option("require_s2s_encryption"); 15 local secure_s2s_only = module:get_option("s2s_require_encryption");
16 16
17 module:add_handler("c2s_unauthed", "starttls", xmlns_starttls, 17 module:add_handler("c2s_unauthed", "starttls", xmlns_starttls,
18 function (session, stanza) 18 function (session, stanza)
19 if session.conn.starttls then 19 if session.conn.starttls then
20 session.send(st.stanza("proceed", { xmlns = xmlns_starttls })); 20 session.send(st.stanza("proceed", { xmlns = xmlns_starttls }));

mercurial