Mercurial > prosody-modules
view mod_sslv3_warn/mod_sslv3_warn.lua @ 4610:342664061c9b
mod_http_upload: Fix issuing slots to components or other non-c2s sessions
The 'full_jid' property only exists on local c2s sessions. This was not
adjusted for in 0a56dc6c61af, so it did not work.
Thanks Fren__ for highlighting the issue.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 01 Jul 2021 16:17:35 +0200 |
parents | 37cef218ba20 |
children |
line wrap: on
line source
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);