diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-10 17:23:03 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-10 17:23:03 +0200 |
commit | 5313a0c5c608dccdee0b663f2072be05203980c0 (patch) | |
tree | 34f9a5027dae52b08928b8d3454af6ffd4c00cd8 /core/portmanager.lua | |
parent | a1ef28548caaf3dc474b4c638aee917e2ca1563d (diff) | |
download | prosody-5313a0c5c608dccdee0b663f2072be05203980c0.tar.gz prosody-5313a0c5c608dccdee0b663f2072be05203980c0.zip |
core.portmanager: Record TLS config for each port
Diffstat (limited to 'core/portmanager.lua')
-rw-r--r-- | core/portmanager.lua | 6 |
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 |