Changeset

13813:fd7b0adada05 13.0

portmanager: Take automatic cert selection into account when setting SNI cert This fixes (another) issue with the fix in 4ea7bd7325be, where it no longer checked the automatic cert index for an appropriate certificate.
author Matthew Wild <mwild1@gmail.com>
date Thu, 03 Apr 2025 12:02:45 +0100
parents 13811:83478fc0806b
children 13814:98e68a68c1da
files core/portmanager.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/portmanager.lua	Wed Apr 02 17:27:39 2025 +0100
+++ b/core/portmanager.lua	Thu Apr 03 12:02:45 2025 +0100
@@ -253,7 +253,8 @@
 				-- TODO should this be some generic thing? e.g. in the service definition
 				alternate_host = config.get(host, "http_host");
 			end
-			local ssl, err, cfg = certmanager.create_context(alternate_host or host, "server", prefix_ssl_config, active_service.tls_cfg);
+			local autocert = certmanager.find_host_cert(alternate_host or host);
+			local ssl, err, cfg = certmanager.create_context(alternate_host or host, "server", prefix_ssl_config, autocert, active_service.tls_cfg);
 			if not ssl then
 				log("error", "Error creating TLS context for SNI host %s: %s", host, err);
 			else