decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
738 stars 291 forks source link

main,gencerts: Punycode non-ASCII hostnames #3427

Closed jrick closed 2 months ago

jrick commented 2 months ago

When a certificate is autogenerated by dcrd or with gencerts, errors would occur if any hostname contained non-ASCII characters. While X509 certificates do support UTF8 strings, Go does not yet support creating these.

Instead, as a workaround and to keep certificate generation working to avoid errors at dcrd startup, convert hostnames with non-ASCII Unicode characters to their IDNA form, which uses Punycode to ASCII-encode the problematic Unicode characters.