plugins/tls.lua

changeset 428
bde804b01f28
parent 384
532a379acfea
child 463
98fe3ed54639
equal deleted inserted replaced
427:fafb3639d4aa 428:bde804b01f28
8 if features_stanza:get_child("starttls", xmlns_tls) and stream.conn.starttls then 8 if features_stanza:get_child("starttls", xmlns_tls) and stream.conn.starttls then
9 stream:debug("Negotiating TLS..."); 9 stream:debug("Negotiating TLS...");
10 stream:send(verse.stanza("starttls", { xmlns = xmlns_tls })); 10 stream:send(verse.stanza("starttls", { xmlns = xmlns_tls }));
11 return true; 11 return true;
12 elseif not stream.conn.starttls and not stream.secure then 12 elseif not stream.conn.starttls and not stream.secure then
13 stream:warn("SSL libary (LuaSec) not loaded, so TLS not available"); 13 stream:warn("SSL library (LuaSec) not loaded, so TLS not available");
14 elseif not stream.secure then 14 elseif not stream.secure then
15 stream:debug("Server doesn't offer TLS :("); 15 stream:debug("Server doesn't offer TLS :(");
16 end 16 end
17 end 17 end
18 local function handle_tls(tls_status) 18 local function handle_tls(tls_status)

mercurial