Mercurial > prosody-hg
diff core/certmanager.lua @ 12105:47c9a76cce7d
core.certmanager: Check index for wildcard certs
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 22 Dec 2021 15:13:49 +0100 |
| parents | 29765ac7f72f |
| children | 0fcd80a55f15 |
line wrap: on
line diff
--- a/core/certmanager.lua Tue Dec 21 21:20:21 2021 +0100 +++ b/core/certmanager.lua Wed Dec 22 15:13:49 2021 +0100 @@ -170,7 +170,8 @@ local function find_cert_in_index(index, host) if not host then return nil; end if not index then return nil; end - local certs = index[host]; + local wildcard_host = host:gsub("^[^.]+%.", "*."); + local certs = index[host] or index[wildcard_host]; if certs then local cert_filename, services = next(certs); if services["*"] then
