From eb9e818e43d4b46f166006064746e5af62cb5b16 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 29 Jan 2021 23:17:08 +0100 Subject: mod_tls: Attempt STARTTLS even if not advertised as per RFC 7590 --- plugins/mod_tls.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 151add6f..6b3045a3 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -150,8 +150,12 @@ end); -- For s2sout connections, start TLS if we can module:hook_tag("http://etherx.jabber.org/streams", "features", function (session, stanza) module:log("debug", "Received features element"); - if can_do_tls(session) and stanza:get_child("starttls", xmlns_starttls) then - module:log("debug", "%s is offering TLS, taking up the offer...", session.to_host); + if can_do_tls(session) then + if stanza:get_child("starttls", xmlns_starttls) then + module:log("debug", "%s is offering TLS, taking up the offer...", session.to_host); + else + module:log("debug", "%s is *not* offering TLS, trying anyways!", session.to_host); + end session.sends2s(starttls_initiate); return true; end -- cgit v1.2.3