mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:41:53 +02:00
Merge remote-tracking branch 'origin/master' into split-cli
This commit is contained in:
@@ -90,6 +90,11 @@ IRC Channel: #letsencrypt on `Freenode`_
|
|||||||
|
|
||||||
Community: https://community.letsencrypt.org
|
Community: https://community.letsencrypt.org
|
||||||
|
|
||||||
|
ACME spec: http://ietf-wg-acme.github.io/acme/
|
||||||
|
|
||||||
|
ACME working area in github: https://github.com/ietf-wg-acme/acme
|
||||||
|
|
||||||
|
|
||||||
Mailing list: `client-dev`_ (to subscribe without a Google account, send an
|
Mailing list: `client-dev`_ (to subscribe without a Google account, send an
|
||||||
email to client-dev+subscribe@letsencrypt.org)
|
email to client-dev+subscribe@letsencrypt.org)
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
|
import six
|
||||||
import socket
|
import socket
|
||||||
import stat
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -310,10 +311,13 @@ def enforce_domain_sanity(domain):
|
|||||||
# Unicode
|
# Unicode
|
||||||
try:
|
try:
|
||||||
domain = domain.encode('ascii').lower()
|
domain = domain.encode('ascii').lower()
|
||||||
except UnicodeDecodeError:
|
except UnicodeError:
|
||||||
raise errors.ConfigurationError(
|
error_fmt = (u"Internationalized domain names "
|
||||||
"Internationalized domain names are not presently supported: {0}"
|
"are not presently supported: {0}")
|
||||||
.format(domain))
|
if isinstance(domain, six.text_type):
|
||||||
|
raise errors.ConfigurationError(error_fmt.format(domain))
|
||||||
|
else:
|
||||||
|
raise errors.ConfigurationError(str(error_fmt).format(domain))
|
||||||
|
|
||||||
# Remove trailing dot
|
# Remove trailing dot
|
||||||
domain = domain[:-1] if domain.endswith('.') else domain
|
domain = domain[:-1] if domain.endswith('.') else domain
|
||||||
|
|||||||
+1
-1
@@ -157,7 +157,7 @@ def _handle_subset_cert_request(config, domains, cert):
|
|||||||
br=os.linesep)
|
br=os.linesep)
|
||||||
if config.expand or config.renew_by_default or zope.component.getUtility(
|
if config.expand or config.renew_by_default or zope.component.getUtility(
|
||||||
interfaces.IDisplay).yesno(question, "Expand", "Cancel",
|
interfaces.IDisplay).yesno(question, "Expand", "Cancel",
|
||||||
cli_flag="--expand (or in some cases, --duplicate)"):
|
cli_flag="--expand"):
|
||||||
return "renew", cert
|
return "renew", cert
|
||||||
else:
|
else:
|
||||||
reporter_util = zope.component.getUtility(interfaces.IReporter)
|
reporter_util = zope.component.getUtility(interfaces.IReporter)
|
||||||
|
|||||||
@@ -323,5 +323,21 @@ class AddDeprecatedArgumentTest(unittest.TestCase):
|
|||||||
self.assertTrue("--old-option" not in stdout.getvalue())
|
self.assertTrue("--old-option" not in stdout.getvalue())
|
||||||
|
|
||||||
|
|
||||||
|
class EnforceDomainSanityTest(unittest.TestCase):
|
||||||
|
"""Test enforce_domain_sanity."""
|
||||||
|
|
||||||
|
def _call(self, domain):
|
||||||
|
from letsencrypt.le_util import enforce_domain_sanity
|
||||||
|
return enforce_domain_sanity(domain)
|
||||||
|
|
||||||
|
def test_nonascii_str(self):
|
||||||
|
self.assertRaises(errors.ConfigurationError, self._call,
|
||||||
|
u"eichh\u00f6rnchen.example.com".encode("utf-8"))
|
||||||
|
|
||||||
|
def test_nonascii_unicode(self):
|
||||||
|
self.assertRaises(errors.ConfigurationError, self._call,
|
||||||
|
u"eichh\u00f6rnchen.example.com")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main() # pragma: no cover
|
unittest.main() # pragma: no cover
|
||||||
|
|||||||
Reference in New Issue
Block a user