Changeset

12205:a2e6605303fa

net.connect: Allow passing TLS context from resolver Only allowing it to be passed directly makes it hard to combine plain (i.e. starttls) and Direct TLS connections in the same connection resolution procedure. But now we can, using chained resolvers!
author Kim Alvefur <zash@zash.se>
date Fri, 21 Jan 2022 17:57:47 +0100
parents 12204:7c397a49d163
children 12206:77ac0d96ac24
files net/connect.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/connect.lua	Fri Jan 21 17:56:20 2022 +0100
+++ b/net/connect.lua	Fri Jan 21 17:57:47 2022 +0100
@@ -42,7 +42,8 @@
 			return;
 		end
 		p:log("debug", "Next target to try is %s:%d", ip, port);
-		local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a", p.options.sslctx, conn_type, extra);
+		local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a",
+			extra and extra.sslctx or p.options.sslctx, conn_type, extra);
 		if not conn then
 			log("debug", "Connection attempt failed immediately: %s", err);
 			p.last_error = err or "unknown reason";