Diff

mod_s2sout_override/mod_s2sout_override.lua @ 5487:6cf2f32dbf40

mod_s2sout_override: Add support for Direct TLS Well that was easy
author Kim Alvefur <zash@zash.se>
date Wed, 24 May 2023 16:34:35 +0200
parent 5486:71243bedb2b0
child 5631:b87a23b45725
line wrap: on
line diff
--- a/mod_s2sout_override/mod_s2sout_override.lua	Wed May 24 15:56:26 2023 +0200
+++ b/mod_s2sout_override/mod_s2sout_override.lua	Wed May 24 16:34:35 2023 +0200
@@ -12,5 +12,8 @@
 	end
 	if type(override) == "table" and override.scheme == "tcp" and type(override.host) == "string" then
 		event.resolver = basic_resolver.new(override.host, tonumber(override.port) or 5269, override.scheme, {});
+	elseif type(override) == "table" and override.scheme == "tls" and type(override.host) == "string" then
+		event.resolver = basic_resolver.new(override.host, tonumber(override.port) or 5270, "tcp",
+			{ servername = event.session.to_host; sslctx = event.session.ssl_ctx });
 	end
 end);