aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-05-05 17:54:44 +0200
committerKim Alvefur <zash@zash.se>2021-05-05 17:54:44 +0200
commit4cd3fcfb0bd2b39e1e6c483e7e3446a3671ef48b (patch)
tree23d3ec7213404668334dab2a9590398a382aca14 /core
parent10fc065796852f28bdb086abd019603cb8631bc0 (diff)
downloadprosody-4cd3fcfb0bd2b39e1e6c483e7e3446a3671ef48b.tar.gz
prosody-4cd3fcfb0bd2b39e1e6c483e7e3446a3671ef48b.zip
core.portmanager: Use existing http_host for https SNI mapping
Diffstat (limited to 'core')
-rw-r--r--core/portmanager.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index 46976368..dc0d0abc 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -238,6 +238,10 @@ local function add_sni_host(host, service)
if config_prefix == "_" then config_prefix = ""; end
local prefix_ssl_config = config.get(host, config_prefix.."ssl");
local alternate_host = service and config.get(host, service.."_host");
+ if not alternate_host and service == "https" then
+ -- TODO should this be some generic thing? e.g. in the service definition
+ alternate_host = config.get(host, "http_host");
+ end
local autocert = certmanager.find_host_cert(alternate_host or host);
-- luacheck: ignore 211/cfg
local ssl, err, cfg = certmanager.create_context(host, "server", prefix_ssl_config, autocert, active_service.tls_cfg);