Exemplo n.º 1
0
 def setUp(self):
     self.jmsg = {
         'type': 'tls-sni-01',
         'token': 'a82d5ff8ef740d12881f6d3c2277ab2e',
     }
     from acme.challenges import TLSSNI01
     self.msg = TLSSNI01(
         token=jose.b64decode('a82d5ff8ef740d12881f6d3c2277ab2e'))
Exemplo n.º 2
0
 def _msg(self):
     from acme.challenges import TLSSNI01
     with warnings.catch_warnings(record=True) as warn:
         warnings.simplefilter("always")
         msg = TLSSNI01(
             token=jose.b64decode('a82d5ff8ef740d12881f6d3c2277ab2e'))
         assert warn is not None  # using a raw assert for mypy
         self.assertTrue(len(warn) == 1)
         self.assertTrue(issubclass(warn[-1].category, DeprecationWarning))
         self.assertTrue('deprecated' in str(warn[-1].message))
     return msg
Exemplo n.º 3
0
    def setUp(self):
        from acme.challenges import TLSSNI01
        self.chall = TLSSNI01(
            token=jose.b64decode(b'a82d5ff8ef740d12881f6d3c2277ab2e'))

        self.response = self.chall.response(KEY)
        self.jmsg = {
            'resource': 'challenge',
            'type': 'tls-sni-01',
            'keyAuthorization': self.response.key_authorization,
        }

        # pylint: disable=invalid-name
        label1 = b'dc38d9c3fa1a4fdcc3a5501f2d38583f'
        label2 = b'b7793728f084394f2a1afd459556bb5c'
        self.z = label1 + label2
        self.z_domain = label1 + b'.' + label2 + b'.acme.invalid'
        self.domain = 'foo.com'
Exemplo n.º 4
0
 def test_from_json_hashable(self):
     from acme.challenges import TLSSNI01
     hash(TLSSNI01.from_json(self.jmsg))
Exemplo n.º 5
0
 def test_from_json(self):
     from acme.challenges import TLSSNI01
     self.assertEqual(self._msg(), TLSSNI01.from_json(self.jmsg))
 def test_from_json_hashable(self):
     from acme.challenges import TLSSNI01
     hash(TLSSNI01.from_json(self.jmsg))
 def test_from_json(self):
     from acme.challenges import TLSSNI01
     self.assertEqual(self.msg, TLSSNI01.from_json(self.jmsg))