diff options
author | Kim Alvefur <zash@zash.se> | 2021-12-22 15:32:04 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-12-22 15:32:04 +0100 |
commit | 1f4fb79d2e9d40fb1468681044d39f03d5bef273 (patch) | |
tree | d903fae10bda8d00079b83180a2849a852e94fcc | |
parent | da1bffce1df086d27722efc7b0bafd7807d7f363 (diff) | |
download | prosody-1f4fb79d2e9d40fb1468681044d39f03d5bef273.tar.gz prosody-1f4fb79d2e9d40fb1468681044d39f03d5bef273.zip |
util.x509: Fix to include wildcard identity
-rw-r--r-- | util/x509.lua | 3 |
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 |