diff options
author | vEpiphyte <epiphyte@vertex.link> | 2022-12-15 19:02:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 19:02:37 -0500 |
commit | 1cafac4d8fc5301d4e58bedbac45722bf7cdfd32 (patch) | |
tree | f30741d04c763aa5a38a3115e5cfa3e0d1438069 /tests | |
parent | 81c9eb16fcc41be06128c23c87eef849676e1a12 (diff) | |
download | pyopenssl-git-1cafac4d8fc5301d4e58bedbac45722bf7cdfd32.tar.gz |
Add support for X509_V_FLAG_PARTIAL_CHAIN (#1166)
* Add support for X509_V_FLAG_PARTIAL_CHAIN
* Remove unneeded import
* Update changelog to add PR number.
* Fix whitespace issue identified by black
Diffstat (limited to 'tests')
-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: """ |