support unknown ACME challenge types

This commit is contained in:
Q 2023-04-20 21:29:54 +01:00
parent 399b932a86
commit 424eec9921
No known key found for this signature in database
GPG key ID: 2A6427FE566B8419
2 changed files with 8 additions and 1 deletions

View file

@ -384,7 +384,8 @@ def challb_to_achall(challb: messages.ChallengeBody, account_key: josepy.JWK,
challb=challb, domain=domain, account_key=account_key)
elif isinstance(chall, challenges.DNS):
return achallenges.DNS(challb=challb, domain=domain)
raise errors.Error(f"Received unsupported challenge of type: {chall.typ}")
else:
return achallenges.Other(challb=challb, domain=domain)
def gen_challenge_path(challbs: List[messages.ChallengeBody],

View file

@ -59,3 +59,9 @@ class DNS(AnnotatedChallenge):
"""Client annotated "dns" ACME challenge."""
__slots__ = ('challb', 'domain') # pylint: disable=redefined-slots-in-subclass
acme_type = challenges.DNS
class Other(AnnotatedChallenge):
"""Client annotated ACME challenge of an unknown type."""
__slots__ = ('challb', 'domain') # pylint: disable=redefined-slots-in-subclass
acme_type = challenges.Challenge