aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-21 17:57:47 +0100
committerKim Alvefur <zash@zash.se>2022-01-21 17:57:47 +0100
commit9f1af0be2e0f546ef10601df189988c069107963 (patch)
tree0c9c857e1bb671692fbf6f2592e3d5df45a454ea /net
parentf31762a075f391c8ba2a8363f8c7d9b5a9713962 (diff)
downloadprosody-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!
Diffstat (limited to 'net')
-rw-r--r--net/connect.lua3
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";