Commit 84338d52 authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

relax certificate chain assertion

parent ee5e5003
Pipeline #300 passed with stages
in 16 minutes and 28 seconds
......@@ -67,12 +67,11 @@ class TestACMEDNSTiny(unittest.TestCase):
# helper function to valid success by making assertion on returned certificate chain
def _assert_certificate_chain(self, cert_chain):
# Output have to contains two certificates
certlist = cert_chain.split("-----BEGIN CERTIFICATE-----")
self.assertEqual(3, len(certlist))
self.assertEqual('', certlist[0])
self.assertIn("-----END CERTIFICATE-----{0}".format(os.linesep), certlist[1])
self.assertIn("-----END CERTIFICATE-----{0}".format(os.linesep), certlist[2])
# Output have to contain at least two certificates to create a chain
certlist = list(filter(None, cert_chain.split("-----BEGIN CERTIFICATE-----")))
self.assertTrue(len(certlist) >= 2)
for cert in certlist:
self.assertIn("-----END CERTIFICATE-----", cert)
# Use openssl to check validity of chain and simple test of readability
readablecertchain = _openssl("x509", ["-text", "-noout"],
cert_chain.encode("utf8"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment