mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Added a descriptive error if domain list includes a Unicode-encoded IDN
This commit is contained in:
@@ -144,6 +144,15 @@ def _check_config_domain_sanity(domains):
|
||||
if any("xn--" in d for d in domains):
|
||||
raise errors.ConfigurationError(
|
||||
"Punycode domains are not supported")
|
||||
|
||||
# Unicode
|
||||
try:
|
||||
for domain in domains:
|
||||
domain.encode('ascii',errors='strict')
|
||||
except UnicodeDecodeError:
|
||||
raise errors.ConfigurationError(
|
||||
"Internationalized domain names are not supported")
|
||||
|
||||
# FQDN checks from
|
||||
# http://www.mkyong.com/regular-expressions/domain-name-regular-expression-example/
|
||||
# Characters used, domain parts < 63 chars, tld > 1 < 64 chars
|
||||
|
||||
Reference in New Issue
Block a user