aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-22 15:13:49 +0100
committerKim Alvefur <zash@zash.se>2021-12-22 15:13:49 +0100
commitda1bffce1df086d27722efc7b0bafd7807d7f363 (patch)
tree3f0063ec83a697c25ef1b2a743e4bc8e70572af6 /core
parent7c93370ad564fc9176b97cf981ed7e10e05d8890 (diff)
downloadprosody-da1bffce1df086d27722efc7b0bafd7807d7f363.tar.gz
prosody-da1bffce1df086d27722efc7b0bafd7807d7f363.zip
core.certmanager: Check index for wildcard certs
Diffstat (limited to 'core')
-rw-r--r--core/certmanager.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua
index 017271d9..17fadced 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -170,7 +170,8 @@ local cert_index;
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