File tree 5 files changed +31
-0
lines changed
5 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 25
25
- {VERSION: "3.9", TOXENV: "py39-cryptographyMain"}
26
26
- {VERSION: "3.10", TOXENV: "py310-cryptographyMain"}
27
27
- {VERSION: "3.11", TOXENV: "py311-cryptographyMain"}
28
+ - {VERSION: "3.11", TOXENV: "py311-cryptography40"}
28
29
- {VERSION: "pypy-3.8", TOXENV: "pypy3-cryptographyMain"}
29
30
- {VERSION: "pypy-3.9", TOXENV: "pypy3-cryptographyMain"}
30
31
# -cryptographyMinimum
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ Changes:
17
17
^^^^^^^^
18
18
19
19
- Invalid versions are now rejected in ``OpenSSL.crypto.X509Req.set_version ``.
20
+ - Added ``Context.set_cert_store `` `#1210 <https://github.com/pyca/pyopenssl/pull/1210 >`_.
20
21
21
22
23.1.1 (2023-03-28)
22
23
-------------------
Original file line number Diff line number Diff line change @@ -1399,6 +1399,24 @@ def get_cert_store(self):
1399
1399
pystore ._store = store
1400
1400
return pystore
1401
1401
1402
+ def set_cert_store (self , store ):
1403
+ """
1404
+ Set the certificate store for the context.
1405
+ :param store: A X509Store object.
1406
+ :return: None
1407
+ """
1408
+ try :
1409
+ _lib .SSL_CTX_set_cert_store (self ._context , store ._store )
1410
+ # The store is now owned by the context, so we need to
1411
+ # remove the gc free in the object. We do this after the
1412
+ # set since set may not exist.
1413
+ _ffi .gc (store ._store , None )
1414
+ except AttributeError :
1415
+ # This can be removed when we depend on >= 40.0.2
1416
+ raise NotImplementedError (
1417
+ "cryptography must be updated to call this method"
1418
+ )
1419
+
1402
1420
def set_options (self , options ):
1403
1421
"""
1404
1422
Add options. Options set before are not cleared!
Original file line number Diff line number Diff line change @@ -1716,6 +1716,15 @@ def test_get_cert_store(self):
1716
1716
store = context .get_cert_store ()
1717
1717
assert isinstance (store , X509Store )
1718
1718
1719
+ def test_set_cert_store (self ):
1720
+ context = Context (SSLv23_METHOD )
1721
+ try :
1722
+ store = X509Store ()
1723
+ context .set_cert_store (store )
1724
+ assert store ._store == context .get_cert_store ()._store
1725
+ except NotImplementedError :
1726
+ pass
1727
+
1719
1728
def test_set_tlsext_use_srtp_not_bytes (self ):
1720
1729
"""
1721
1730
`Context.set_tlsext_use_srtp' enables negotiating SRTP keying material.
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ extras =
19
19
deps =
20
20
coverage>=4.2
21
21
cryptographyMinimum: cryptography ==38.0.0
22
+ # special version to test paths for bindings we temporarily removed
23
+ cryptography40: cryptography ==40.0.1
22
24
randomorder: pytest-randomly
23
25
setenv =
24
26
# Do not allow the executing environment to pollute the test environment
You can’t perform that action at this time.
0 commit comments