Changeset

11536:fb9bd9fa4356

core.portmanager: Use existing http_host for https SNI mapping
author Kim Alvefur <zash@zash.se>
date Wed, 05 May 2021 17:54:44 +0200
parents 11535:180c5951e7e4
children 11537:a09685a7b330
files core/portmanager.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/portmanager.lua	Wed May 05 17:52:51 2021 +0200
+++ b/core/portmanager.lua	Wed May 05 17:54:44 2021 +0200
@@ -238,6 +238,10 @@
 			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);