mirror of
https://github.com/certbot/certbot.git
synced 2026-06-09 00:32:12 -04:00
fixes #2661
This commit is contained in:
parent
2b3004c97a
commit
3fb990ac9b
1 changed files with 8 additions and 4 deletions
|
|
@ -6,6 +6,7 @@ import logging
|
|||
import os
|
||||
import platform
|
||||
import re
|
||||
import six
|
||||
import socket
|
||||
import stat
|
||||
import subprocess
|
||||
|
|
@ -310,10 +311,13 @@ def enforce_domain_sanity(domain):
|
|||
# Unicode
|
||||
try:
|
||||
domain = domain.encode('ascii').lower()
|
||||
except UnicodeDecodeError:
|
||||
raise errors.ConfigurationError(
|
||||
"Internationalized domain names are not presently supported: {0}"
|
||||
.format(domain))
|
||||
except UnicodeError:
|
||||
error_fmt = ("Internationalized domain names "
|
||||
"are not presently supported: {0}")
|
||||
if isinstance(domain, six.text_type):
|
||||
raise errors.ConfigurationError(unicode(error_fmt).format(domain))
|
||||
else:
|
||||
raise errors.ConfigurationError(error_fmt.format(domain))
|
||||
|
||||
# Remove trailing dot
|
||||
domain = domain[:-1] if domain.endswith('.') else domain
|
||||
|
|
|
|||
Loading…
Reference in a new issue