# HG changeset patch # User Kim Alvefur # Date 1640182429 -3600 # Node ID 47c9a76cce7df06da605b2bdbe3100c51b80b76c # Parent 29765ac7f72f168bcdcfb1dcbeaaabc311601d82 core.certmanager: Check index for wildcard certs diff -r 29765ac7f72f -r 47c9a76cce7d core/certmanager.lua --- 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