Diff

plugins/mod_tls.lua @ 11340:a7109eb45e30

mod_tls: Attempt STARTTLS even if not advertised as per RFC 7590
author Kim Alvefur <zash@zash.se>
date Fri, 29 Jan 2021 23:17:08 +0100
parent 10784:0b0fe73199d2
child 11341:c567e5e2b77a
line wrap: on
line diff
--- a/plugins/mod_tls.lua	Fri Jan 29 23:14:48 2021 +0100
+++ b/plugins/mod_tls.lua	Fri Jan 29 23:17:08 2021 +0100
@@ -150,8 +150,12 @@
 -- 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