mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Rename --simple-http-port to --http-01-port
This commit is contained in:
parent
1d36a15ab7
commit
23d3c3b1e2
11 changed files with 23 additions and 23 deletions
|
|
@ -854,8 +854,8 @@ def prepare_and_parse_args(plugins, args):
|
|||
helpful.add(
|
||||
"testing", "--dvsni-port", type=int, default=flag_default("dvsni_port"),
|
||||
help=config_help("dvsni_port"))
|
||||
helpful.add("testing", "--simple-http-port", type=int,
|
||||
help=config_help("simple_http_port"))
|
||||
helpful.add("testing", "--http-01-port", dest="http01_port", type=int,
|
||||
help=config_help("http01_port"))
|
||||
|
||||
helpful.add_group(
|
||||
"security", description="Security parameters & server settings")
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class NamespaceConfig(object):
|
|||
def __init__(self, namespace):
|
||||
self.namespace = namespace
|
||||
|
||||
if self.simple_http_port == self.dvsni_port:
|
||||
if self.http01_port == self.dvsni_port:
|
||||
raise errors.Error(
|
||||
"Trying to run http-01 and DVSNI "
|
||||
"on the same port ({0})".format(self.dvsni_port))
|
||||
|
|
@ -78,9 +78,9 @@ class NamespaceConfig(object):
|
|||
self.namespace.work_dir, constants.TEMP_CHECKPOINT_DIR)
|
||||
|
||||
@property
|
||||
def simple_http_port(self): # pylint: disable=missing-docstring
|
||||
if self.namespace.simple_http_port is not None:
|
||||
return self.namespace.simple_http_port
|
||||
def http01_port(self): # pylint: disable=missing-docstring
|
||||
if self.namespace.http01_port is not None:
|
||||
return self.namespace.http01_port
|
||||
else:
|
||||
return challenges.HTTP01Response.PORT
|
||||
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class IConfig(zope.interface.Interface):
|
|||
"Port number to perform DVSNI challenge. "
|
||||
"Boulder in testing mode defaults to 5001.")
|
||||
|
||||
simple_http_port = zope.interface.Attribute(
|
||||
http01_port = zope.interface.Attribute(
|
||||
"Port used in the SimpleHttp challenge.")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ s.serve_forever()" """
|
|||
# same server: default command doesn't support virtual hosts
|
||||
response, validation = achall.response_and_validation()
|
||||
|
||||
port = (response.port if self.config.simple_http_port is None
|
||||
else int(self.config.simple_http_port))
|
||||
port = (response.port if self.config.http01_port is None
|
||||
else int(self.config.http01_port))
|
||||
command = self.CMD_TEMPLATE.format(
|
||||
root=self._root, achall=achall, response=response,
|
||||
# TODO(kuba): pipes still necessary?
|
||||
|
|
@ -174,7 +174,7 @@ s.serve_forever()" """
|
|||
|
||||
if response.simple_verify(
|
||||
achall.chall, achall.domain,
|
||||
achall.account_key.public_key(), self.config.simple_http_port):
|
||||
achall.account_key.public_key(), self.config.http01_port):
|
||||
return response
|
||||
else:
|
||||
logger.error(
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ class AuthenticatorTest(unittest.TestCase):
|
|||
def setUp(self):
|
||||
from letsencrypt.plugins.manual import Authenticator
|
||||
self.config = mock.MagicMock(
|
||||
simple_http_port=8080, manual_test_mode=False)
|
||||
http01_port=8080, manual_test_mode=False)
|
||||
self.auth = Authenticator(config=self.config, name="manual")
|
||||
self.achalls = [achallenges.KeyAuthorizationAnnotatedChallenge(
|
||||
challb=acme_util.HTTP01_P, domain="foo.com", account_key=KEY)]
|
||||
|
||||
config_test_mode = mock.MagicMock(
|
||||
simple_http_port=8080, manual_test_mode=True)
|
||||
http01_port=8080, manual_test_mode=True)
|
||||
self.auth_test_mode = Authenticator(
|
||||
config=config_test_mode, name="manual")
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class Authenticator(common.Plugin):
|
|||
def _necessary_ports(self):
|
||||
necessary_ports = set()
|
||||
if challenges.HTTP01 in self.supported_challenges:
|
||||
necessary_ports.add(self.config.simple_http_port)
|
||||
necessary_ports.add(self.config.http01_port)
|
||||
if challenges.DVSNI in self.supported_challenges:
|
||||
necessary_ports.add(self.config.dvsni_port)
|
||||
return necessary_ports
|
||||
|
|
@ -238,7 +238,7 @@ class Authenticator(common.Plugin):
|
|||
for achall in achalls:
|
||||
if isinstance(achall.chall, challenges.HTTP01):
|
||||
server = self.servers.run(
|
||||
self.config.simple_http_port, challenges.HTTP01)
|
||||
self.config.http01_port, challenges.HTTP01)
|
||||
response, validation = achall.response_and_validation()
|
||||
self.simple_http_resources.add(
|
||||
acme_standalone.HTTP01RequestHandler.HTTP01Resource(
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class AuthenticatorTest(unittest.TestCase):
|
|||
def setUp(self):
|
||||
from letsencrypt.plugins.standalone import Authenticator
|
||||
self.config = mock.MagicMock(
|
||||
dvsni_port=1234, simple_http_port=4321,
|
||||
dvsni_port=1234, http01_port=4321,
|
||||
standalone_supported_challenges="dvsni,http-01")
|
||||
self.auth = Authenticator(self.config, name="standalone")
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ def renew(cert, old_version):
|
|||
# was an int, not a str)
|
||||
config.rsa_key_size = int(config.rsa_key_size)
|
||||
config.dvsni_port = int(config.dvsni_port)
|
||||
config.namespace.simple_http_port = int(config.namespace.simple_http_port)
|
||||
config.namespace.http01_port = int(config.namespace.http01_port)
|
||||
zope.component.provideUtility(config)
|
||||
try:
|
||||
authenticator = plugins[renewalparams["authenticator"]]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class NamespaceConfigTest(unittest.TestCase):
|
|||
self.namespace = mock.MagicMock(
|
||||
config_dir='/tmp/config', work_dir='/tmp/foo', foo='bar',
|
||||
server='https://acme-server.org:443/new',
|
||||
dvsni_port=1234, simple_http_port=4321)
|
||||
dvsni_port=1234, http01_port=4321)
|
||||
from letsencrypt.configuration import NamespaceConfig
|
||||
self.config = NamespaceConfig(self.namespace)
|
||||
|
||||
|
|
@ -54,10 +54,10 @@ class NamespaceConfigTest(unittest.TestCase):
|
|||
self.assertEqual(self.config.key_dir, '/tmp/config/keys')
|
||||
self.assertEqual(self.config.temp_checkpoint_dir, '/tmp/foo/t')
|
||||
|
||||
def test_simple_http_port(self):
|
||||
self.assertEqual(4321, self.config.simple_http_port)
|
||||
self.namespace.simple_http_port = None
|
||||
self.assertEqual(80, self.config.simple_http_port)
|
||||
def test_http01_port(self):
|
||||
self.assertEqual(4321, self.config.http01_port)
|
||||
self.namespace.http01_port = None
|
||||
self.assertEqual(80, self.config.http01_port)
|
||||
|
||||
|
||||
class RenewerConfigurationTest(unittest.TestCase):
|
||||
|
|
|
|||
|
|
@ -689,7 +689,7 @@ class RenewableCertTests(BaseRenewableCertTest):
|
|||
self.test_rc.configfile["renewalparams"]["server"] = "acme.example.com"
|
||||
self.test_rc.configfile["renewalparams"]["authenticator"] = "fake"
|
||||
self.test_rc.configfile["renewalparams"]["dvsni_port"] = "4430"
|
||||
self.test_rc.configfile["renewalparams"]["simple_http_port"] = "1234"
|
||||
self.test_rc.configfile["renewalparams"]["http01_port"] = "1234"
|
||||
self.test_rc.configfile["renewalparams"]["account"] = "abcde"
|
||||
mock_auth = mock.MagicMock()
|
||||
mock_pd.PluginsRegistry.find_all.return_value = {"apache": mock_auth}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ letsencrypt_test () {
|
|||
--server "${SERVER:-http://localhost:4000/directory}" \
|
||||
--no-verify-ssl \
|
||||
--dvsni-port 5001 \
|
||||
--simple-http-port 5002 \
|
||||
--http-01-port 5002 \
|
||||
--manual-test-mode \
|
||||
$store_flags \
|
||||
--text \
|
||||
|
|
|
|||
Loading…
Reference in a new issue