# HG changeset patch # User Matthew Wild # Date 1273615612 -3600 # Node ID 311e6117615962b2145352189ee779e14ee5ebde # Parent d4b6f9e33c6e897074890df94a2ab754d2887e7f verse.plugins.tls: Fail gracefully when LuaSec not loaded diff -r d4b6f9e33c6e -r 311e61176159 plugins/tls.lua --- 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