# HG changeset patch # User Matthew Wild # Date 1743678165 -3600 # Node ID fd7b0adada05ed8155900c2c3226d8495e7ac53e # Parent 83478fc0806bea49aaca4cb995cdacd50bb6e7fc 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. diff -r 83478fc0806b -r fd7b0adada05 core/portmanager.lua --- 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