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) |