mod_disable_tls/mod_disable_tls.lua
author Kim Alvefur <zash@zash.se>
Sat, 06 Apr 2024 13:04:35 +0200
changeset 5882 13094c707414
parent 1482 25be5fde250f
permissions -rw-r--r--
mod_client_management: Prevent exception on missing client info > attempt to index a nil value (local 'legacy_info') Unsure how exactly this happens, perhaps by mixing SASL2/BIND2 with legacy equivalents?

local disable_tls_ports = module:get_option_set("disable_tls_ports", {});

module:hook("stream-features", function (event)
	if disable_tls_ports:contains(event.origin.conn:serverport()) then
		module:log("error", "Disabling TLS for client on port %d", event.origin.conn:serverport());
		event.origin.conn.starttls = false;
	end
end, 1000);