mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Don't error immediately on wildcards. (#5600)
This commit is contained in:
parent
ea3b78e3c9
commit
f3b23662f1
3 changed files with 4 additions and 17 deletions
|
|
@ -300,8 +300,8 @@ class ChooseNamesTest(unittest.TestCase):
|
|||
from certbot.display.ops import get_valid_domains
|
||||
all_valid = ["example.com", "second.example.com",
|
||||
"also.example.com", "under_score.example.com",
|
||||
"justtld"]
|
||||
all_invalid = ["öóòps.net", "*.wildcard.com", "uniçodé.com"]
|
||||
"justtld", "*.wildcard.com"]
|
||||
all_invalid = ["öóòps.net", "uniçodé.com"]
|
||||
two_valid = ["example.com", "úniçøde.com", "also.example.com"]
|
||||
self.assertEqual(get_valid_domains(all_valid), all_valid)
|
||||
self.assertEqual(get_valid_domains(all_invalid), [])
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# coding=utf-8
|
||||
"""Tests for certbot.main."""
|
||||
# pylint: disable=too-many-lines
|
||||
from __future__ import print_function
|
||||
|
|
@ -939,10 +940,6 @@ class MainTest(test_util.ConfigTestCase): # pylint: disable=too-many-public-met
|
|||
self.assertRaises(errors.ConfigurationError,
|
||||
self._call,
|
||||
['-d', (('a' * 50) + '.') * 10])
|
||||
# Wildcard
|
||||
self.assertRaises(errors.ConfigurationError,
|
||||
self._call,
|
||||
['-d', '*.wildcard.tld'])
|
||||
|
||||
# Bare IP address (this is actually a different error message now)
|
||||
self.assertRaises(errors.ConfigurationError,
|
||||
|
|
@ -1232,7 +1229,7 @@ class MainTest(test_util.ConfigTestCase): # pylint: disable=too-many-public-met
|
|||
|
||||
def test_renew_with_bad_domain(self):
|
||||
renewalparams = {'authenticator': 'webroot'}
|
||||
names = ['*.example.com']
|
||||
names = ['uniçodé.com']
|
||||
self._test_renew_common(renewalparams=renewalparams, error_expected=True,
|
||||
names=names, assert_oc_called=False)
|
||||
|
||||
|
|
|
|||
|
|
@ -552,16 +552,6 @@ def enforce_domain_sanity(domain):
|
|||
:returns: The domain cast to `str`, with ASCII-only contents
|
||||
:rtype: str
|
||||
"""
|
||||
if isinstance(domain, six.text_type):
|
||||
wildcard_marker = u"*."
|
||||
else:
|
||||
wildcard_marker = b"*."
|
||||
|
||||
# Check if there's a wildcard domain
|
||||
if domain.startswith(wildcard_marker):
|
||||
raise errors.ConfigurationError(
|
||||
"Wildcard domains are not supported: {0}".format(domain))
|
||||
|
||||
# Unicode
|
||||
try:
|
||||
if isinstance(domain, six.binary_type):
|
||||
|
|
|
|||
Loading…
Reference in a new issue