aboutsummaryrefslogtreecommitdiffstats
path: root/tests/x509/test_x509.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/x509/test_x509.py')
-rw-r--r--tests/x509/test_x509.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/x509/test_x509.py b/tests/x509/test_x509.py
index 4a34d4a9..720db78e 100644
--- a/tests/x509/test_x509.py
+++ b/tests/x509/test_x509.py
@@ -3752,6 +3752,18 @@ class TestOtherCertificate(object):
with pytest.raises(ValueError):
cert.public_key()
+ def test_bad_time_in_validity(self, backend):
+ cert = _load_cert(
+ os.path.join(
+ "x509", "badasn1time.pem"
+ ),
+ x509.load_pem_x509_certificate,
+ backend,
+ )
+
+ with pytest.raises(ValueError, match='19020701025736Z'):
+ cert.not_valid_after
+
class TestNameAttribute(object):
EXPECTED_TYPES = [