# HG changeset patch # User Kim Alvefur # Date 1640183524 -3600 # Node ID c0cb8e86ad214a4ef002c0be45df2e6a0b6b74ab # Parent 47c9a76cce7df06da605b2bdbe3100c51b80b76c util.x509: Fix to include wildcard identity diff -r 47c9a76cce7d -r c0cb8e86ad21 util/x509.lua --- a/util/x509.lua Wed Dec 22 15:13:49 2021 +0100 +++ b/util/x509.lua Wed Dec 22 15:32:04 2021 +0100 @@ -232,8 +232,11 @@ 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