diff options
Diffstat (limited to 'tests/test_crypto.py')
-rw-r--r-- | tests/test_crypto.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_crypto.py b/tests/test_crypto.py index e7b13fc..88756f0 100644 --- a/tests/test_crypto.py +++ b/tests/test_crypto.py @@ -4285,6 +4285,19 @@ class TestX509StoreContext: assert str(exc.value) == "unable to get local issuer certificate" + def test_verify_with_partial_chain(self): + store = X509Store() + store.add_cert(self.intermediate_cert) + + store_ctx = X509StoreContext(store, self.intermediate_server_cert) + with pytest.raises(X509StoreContextError): + store_ctx.verify_certificate() + + # Now set the partial verification flag for verification. + store.set_flags(X509StoreFlags.PARTIAL_CHAIN) + store_ctx = X509StoreContext(store, self.intermediate_server_cert) + assert store_ctx.verify_certificate() is None + class TestSignVerify: """ |