mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:42:02 +02:00
Move relevant constants to acme module.
This commit is contained in:
@@ -88,6 +88,9 @@ class DVSNI(DVChallenge):
|
|||||||
NONCE_SIZE = 16
|
NONCE_SIZE = 16
|
||||||
"""Required size of the :attr:`nonce` in bytes."""
|
"""Required size of the :attr:`nonce` in bytes."""
|
||||||
|
|
||||||
|
PORT = 443
|
||||||
|
"""Port to perform DVSNI challenge."""
|
||||||
|
|
||||||
r = jose.Field("r", encoder=jose.b64encode, # pylint: disable=invalid-name
|
r = jose.Field("r", encoder=jose.b64encode, # pylint: disable=invalid-name
|
||||||
decoder=functools.partial(jose.decode_b64jose, size=R_SIZE))
|
decoder=functools.partial(jose.decode_b64jose, size=R_SIZE))
|
||||||
nonce = jose.Field("nonce", encoder=binascii.hexlify,
|
nonce = jose.Field("nonce", encoder=binascii.hexlify,
|
||||||
|
|||||||
@@ -4,14 +4,6 @@ import pkg_resources
|
|||||||
from letsencrypt.acme import challenges
|
from letsencrypt.acme import challenges
|
||||||
|
|
||||||
|
|
||||||
S_SIZE = 32
|
|
||||||
"""Size (in bytes) of secret base64-encoded octet string "s" used in
|
|
||||||
challenges."""
|
|
||||||
|
|
||||||
NONCE_SIZE = 16
|
|
||||||
"""Size of nonce used in JWS objects (in bytes)."""
|
|
||||||
|
|
||||||
|
|
||||||
EXCLUSIVE_CHALLENGES = frozenset([frozenset([
|
EXCLUSIVE_CHALLENGES = frozenset([frozenset([
|
||||||
challenges.DVSNI, challenges.SimpleHTTPS])])
|
challenges.DVSNI, challenges.SimpleHTTPS])])
|
||||||
"""Mutually exclusive challenges."""
|
"""Mutually exclusive challenges."""
|
||||||
@@ -46,10 +38,6 @@ NGINX_MOD_SSL_CONF = pkg_resources.resource_filename(
|
|||||||
distribution."""
|
distribution."""
|
||||||
|
|
||||||
|
|
||||||
DVSNI_CHALLENGE_PORT = 443
|
|
||||||
"""Port to perform DVSNI challenge."""
|
|
||||||
|
|
||||||
|
|
||||||
TEMP_CHECKPOINT_DIR = "temp_checkpoint"
|
TEMP_CHECKPOINT_DIR = "temp_checkpoint"
|
||||||
"""Temporary checkpoint directory (relative to IConfig.work_dir)."""
|
"""Temporary checkpoint directory (relative to IConfig.work_dir)."""
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import zope.interface
|
|||||||
from letsencrypt.acme import challenges
|
from letsencrypt.acme import challenges
|
||||||
|
|
||||||
from letsencrypt.client import achallenges
|
from letsencrypt.client import achallenges
|
||||||
from letsencrypt.client import constants
|
|
||||||
from letsencrypt.client import interfaces
|
from letsencrypt.client import interfaces
|
||||||
|
|
||||||
|
|
||||||
@@ -362,7 +361,7 @@ class StandaloneAuthenticator(object):
|
|||||||
results_if_failure.append(False)
|
results_if_failure.append(False)
|
||||||
if not self.tasks:
|
if not self.tasks:
|
||||||
raise ValueError("nothing for .perform() to do")
|
raise ValueError("nothing for .perform() to do")
|
||||||
if self.already_listening(constants.DVSNI_CHALLENGE_PORT):
|
if self.already_listening(challenges.DVSNI.PORT):
|
||||||
# If we know a process is already listening on this port,
|
# If we know a process is already listening on this port,
|
||||||
# tell the user, and don't even attempt to bind it. (This
|
# tell the user, and don't even attempt to bind it. (This
|
||||||
# test is Linux-specific and won't indicate that the port
|
# test is Linux-specific and won't indicate that the port
|
||||||
@@ -370,7 +369,7 @@ class StandaloneAuthenticator(object):
|
|||||||
return results_if_failure
|
return results_if_failure
|
||||||
# Try to do the authentication; note that this creates
|
# Try to do the authentication; note that this creates
|
||||||
# the listener subprocess via os.fork()
|
# the listener subprocess via os.fork()
|
||||||
if self.start_listener(constants.DVSNI_CHALLENGE_PORT, key):
|
if self.start_listener(challenges.DVSNI.PORT, key):
|
||||||
return results_if_success
|
return results_if_success
|
||||||
else:
|
else:
|
||||||
# TODO: This should probably raise a DVAuthError exception
|
# TODO: This should probably raise a DVAuthError exception
|
||||||
|
|||||||
Reference in New Issue
Block a user