diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2025-06-04 01:35:57 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-06-04 01:35:57 +0900 |
commit | 10bffe228843ea4c59110fc9ce40663a7a144338 (patch) | |
tree | a6c2183225837eff0270153b16196e70001e087b | |
parent | cb1b5c48145f9c23eae95f922c6af804466bcb42 (diff) | |
download | scadere-10bffe228843ea4c59110fc9ce40663a7a144338.tar.gz |
Supply not-before time for fake certs
-rw-r--r-- | tst/test_check.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tst/test_check.py b/tst/test_check.py index f809a90..0ebc0ab 100644 --- a/tst/test_check.py +++ b/tst/test_check.py @@ -74,8 +74,7 @@ async def get_cert_summary(netloc, after, ca): async def test_check(domain, ca_name, not_after, after, trust_ca): ctx = tls_context(Purpose.CLIENT_AUTH) ca = CA(organization_name=ca_name) - # TODO: not_before = SECONDS_AGO for reproducible build - cert = ca.issue_cert(domain, not_after=not_after) + cert = ca.issue_cert(domain, not_before=SECONDS_AGO, not_after=not_after) cert.configure_cert(ctx) ca.configure_trust(ctx) async with await start_server(noop, domain, ssl=ctx) as server: @@ -92,7 +91,7 @@ async def test_check(domain, ca_name, not_after, after, trust_ca): elif not_after > after: assert summary is None else: - # TODO: assert on summary[0] + assert summary[0] == SECONDS_AGO.isoformat(timespec='seconds') assert summary[1] == not_after.isoformat(timespec='seconds') assert summary[2] == domain assert summary[3] == str(port) |