# HG changeset patch # User Kim Alvefur # Date 1642784267 -3600 # Node ID a2e6605303faf5401970ee7a6c953c7bef57c7d0 # Parent 7c397a49d1632832df0cfc045ad36b1348e8ce98 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! diff -r 7c397a49d163 -r a2e6605303fa net/connect.lua --- 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";