aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-10 17:23:03 +0200
committerKim Alvefur <zash@zash.se>2018-10-10 17:23:03 +0200
commit7e568a68dc06ca5fda2786cdb16b86d7715ee309 (patch)
tree34f9a5027dae52b08928b8d3454af6ffd4c00cd8 /core
parentac2aeb46621d033813e7ca0730302dfff2a6d4a6 (diff)
downloadprosody-7e568a68dc06ca5fda2786cdb16b86d7715ee309.tar.gz
prosody-7e568a68dc06ca5fda2786cdb16b86d7715ee309.zip
core.portmanager: Record TLS config for each port
Diffstat (limited to 'core')
-rw-r--r--core/portmanager.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index db41e1ea..17758a36 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -107,12 +107,12 @@ local function activate(service_name)
log("error", "Multiple services configured to listen on the same port ([%s]:%d): %s, %s", interface, port,
active_services:search(nil, interface, port)[1][1].service.name or "<unnamed>", service_name or "<unnamed>");
else
- local ssl, err;
+ local ssl, cfg, err;
-- Create SSL context for this service/port
if service_info.encryption == "ssl" then
local global_ssl_config = config.get("*", "ssl") or {};
local prefix_ssl_config = config.get("*", config_prefix.."ssl") or global_ssl_config;
- ssl, err = certmanager.create_context(service_info.name.." port "..port, "server",
+ ssl, err, cfg = certmanager.create_context(service_info.name.." port "..port, "server",
prefix_ssl_config[interface],
prefix_ssl_config[port],
prefix_ssl_config,
@@ -130,6 +130,7 @@ local function activate(service_name)
read_size = mode,
tls_ctx = ssl,
tls_direct = service_info.encryption == "ssl";
+ sni_hosts = {},
});
if not handler then
log("error", "Failed to open server port %d on %s, %s", port_number, interface,
@@ -140,6 +141,7 @@ local function activate(service_name)
active_services:add(service_name, interface, port_number, {
server = handler;
service = service_info;
+ tls_cfg = cfg;
});
end
end