diff options
author | Adrien Ferrand <adferrand@users.noreply.github.com> | 2020-03-13 19:56:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 19:56:35 +0300 |
commit | 809cb516c918575bc1688141dfe9b4da001d6570 (patch) | |
tree | 5db81e2e72c4b5a4db1cf1b7804d954c3fe44eac /acme/tests/challenges_test.py | |
parent | 07abe7a8d68961042ee301039dd4da87306cb1a0 (diff) |
Fix acme compliance to RFC 8555 (#7176)
This PR is an alternative to #7125.
Instead of disabling the strict mode on Pebble, this PR fixes the JWS payloads regarding RFC 8555 to be compliant, and allow certbot to work with Pebble v2.1.0+.
* Fix acme compliance to RFC 8555.
* Working mixin
* Activate back pebble strict mode
* Use mixin for type
* Update dependencies
* Fix also in fields_to_partial_json
* Update pebble
* Add changelog
Diffstat (limited to 'acme/tests/challenges_test.py')
-rw-r--r-- | acme/tests/challenges_test.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/acme/tests/challenges_test.py b/acme/tests/challenges_test.py index 2b44d677d..433c7bb82 100644 --- a/acme/tests/challenges_test.py +++ b/acme/tests/challenges_test.py @@ -478,5 +478,18 @@ class DNSResponseTest(unittest.TestCase): self.msg.check_validation(self.chall, KEY.public_key())) +class JWSPayloadRFC8555Compliant(unittest.TestCase): + """Test for RFC8555 compliance of JWS generated from resources/challenges""" + def test_challenge_payload(self): + from acme.challenges import HTTP01Response + + challenge_body = HTTP01Response() + challenge_body.le_acme_version = 2 + + jobj = challenge_body.json_dumps(indent=2).encode() + # RFC8555 states that challenge responses must have an empty payload. + self.assertEqual(jobj, b'{}') + + if __name__ == '__main__': unittest.main() # pragma: no cover |