diff options
author | Kim Alvefur <zash@zash.se> | 2022-01-21 17:57:47 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-01-21 17:57:47 +0100 |
commit | 9f1af0be2e0f546ef10601df189988c069107963 (patch) | |
tree | 0c9c857e1bb671692fbf6f2592e3d5df45a454ea | |
parent | f31762a075f391c8ba2a8363f8c7d9b5a9713962 (diff) | |
download | prosody-9f1af0be2e0f546ef10601df189988c069107963.tar.gz prosody-9f1af0be2e0f546ef10601df189988c069107963.zip |
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!
-rw-r--r-- | net/connect.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/connect.lua b/net/connect.lua index dbdd3ce6..4b602be4 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -42,7 +42,8 @@ local function attempt_connection(p) 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"; |