Changeset

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 12104:29765ac7f72f
children 12106:c0cb8e86ad21
files core/certmanager.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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