aboutsummaryrefslogtreecommitdiffstats
path: root/util/x509.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-22 15:32:04 +0100
committerKim Alvefur <zash@zash.se>2021-12-22 15:32:04 +0100
commit1f4fb79d2e9d40fb1468681044d39f03d5bef273 (patch)
treed903fae10bda8d00079b83180a2849a852e94fcc /util/x509.lua
parentda1bffce1df086d27722efc7b0bafd7807d7f363 (diff)
downloadprosody-1f4fb79d2e9d40fb1468681044d39f03d5bef273.tar.gz
prosody-1f4fb79d2e9d40fb1468681044d39f03d5bef273.zip
util.x509: Fix to include wildcard identity
Diffstat (limited to 'util/x509.lua')
-rw-r--r--util/x509.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/x509.lua b/util/x509.lua
index 342dafde..76b50076 100644
--- a/util/x509.lua
+++ b/util/x509.lua
@@ -232,8 +232,11 @@ local function get_identities(cert) --> map of names to sets of services
if sans then
if sans["dNSName"] then -- Valid for any service
for _, name in ipairs(sans["dNSName"]) do
+ local is_wildcard = name:sub(1, 2) == "*.";
+ if is_wildcard then name = name:sub(3); end
name = idna_to_unicode(nameprep(name));
if name then
+ if is_wildcard then name = "*." .. name; end
names:set(name, "*", true);
end
end