Software /
code /
verse
Diff
plugins/tls.lua @ 63:311e61176159
verse.plugins.tls: Fail gracefully when LuaSec not loaded
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 11 May 2010 23:06:52 +0100 |
parent | 61:6adddfdf974b |
child | 65:4f13cc5f96b0 |
line wrap: on
line diff
--- a/plugins/tls.lua Tue May 11 23:05:26 2010 +0100 +++ b/plugins/tls.lua Tue May 11 23:06:52 2010 +0100 @@ -4,10 +4,12 @@ function verse.plugins.tls(stream) local function handle_features(features_stanza) if stream.authenticated then return; end - if features_stanza:get_child("starttls", xmlns_tls) then + if features_stanza:get_child("starttls", xmlns_tls) and stream.conn.starttls then stream:debug("Negotiating TLS..."); stream:send(st.stanza("starttls", { xmlns = xmlns_tls })); return true; + elseif not stream.conn.starttls then + stream:warn("SSL libary (LuaSec) not loaded, so TLS not available"); else stream:debug("Server doesn't offer TLS :("); end