# HG changeset patch # User Kim Alvefur # Date 1413365859 -7200 # Node ID 37cef218ba20394f326f8fb91506beea2349f97d # Parent 604a8cee9d5870a7f8c0747b811b8e77951942fb mod_sslv3_warn: Module to notice users connected with SSLv3 that they need to upgrade becasue SSLv3 is insecure diff -r 604a8cee9d58 -r 37cef218ba20 mod_sslv3_warn/mod_sslv3_warn.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_sslv3_warn/mod_sslv3_warn.lua Wed Oct 15 11:37:39 2014 +0200 @@ -0,0 +1,22 @@ +local st = require"util.stanza"; +local host = module.host; + +local warning_message = module:get_option_string("sslv3_warning", "Your connection is encrypted using the SSL 3.0 protocol, which has been demonstrated to be insecure and will be disabled soon. Please upgrade your client."); + +module:hook("resource-bind", function (event) + local session = event.session; + module:log("debug", "mod_%s sees that %s logged in", module.name, session.username); + + local ok, protocol = pcall(function(session) + return session.conn:socket():info"protocol"; + end, session); + if not ok then + module:log("debug", protocol); + elseif protocol == "SSLv3" then + module:add_timer(15, function () + if session.type == "c2s" and session.resource then + session.send(st.message({ from = host, type = "headline", to = session.full_jid }, warning_message)); + end + end); + end +end);