Software /
code /
prosody
Changeset
11535:180c5951e7e4
core.portmanager: Allow overriding expected SNI name per service
E.g.
VirtualHost"example.com"
https_name = "xmpp.example.com"
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 05 May 2021 17:52:51 +0200 |
parents | 11534:1cef62ca3e03 |
children | 11536:fb9bd9fa4356 |
files | core/portmanager.lua |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/portmanager.lua Wed May 05 15:56:39 2021 +0200 +++ b/core/portmanager.lua Wed May 05 17:52:51 2021 +0200 @@ -237,11 +237,12 @@ local config_prefix = (active_service.config_prefix or name).."_"; if config_prefix == "_" then config_prefix = ""; end local prefix_ssl_config = config.get(host, config_prefix.."ssl"); - local autocert = certmanager.find_host_cert(host); + local alternate_host = service and config.get(host, service.."_host"); + 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); if ssl then - active_service.server.hosts[host] = ssl; + active_service.server.hosts[alternate_host or host] = ssl; else log("error", "Error creating TLS context for SNI host %s: %s", host, err); end