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