aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);