Fix creation of wildcard DNS in SAN in x509_v2

This commit is contained in:
jeanluc 2023-08-29 01:22:57 +02:00 committed by Megan Wilhite
parent 97dad46ffc
commit 0db673aff6
2 changed files with 5 additions and 1 deletions

1
changelog/65072.fixed.md Normal file
View file

@ -0,0 +1 @@
Fixed creation of wildcard DNS in SAN in `x509_v2`

View file

@ -1691,7 +1691,10 @@ def _parse_general_names(val):
if allow_leading_dot:
has_dot = val.startswith(".")
val = val.lstrip(".")
ret = idna.encode(val).decode()
ret = ".".join(
idna.encode(elem).decode() if elem != "*" else elem
for elem in val.split(".")
)
if has_dot:
return f".{ret}"
return ret