File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ Upgrade truststore to 0.9.2
Original file line number Diff line number Diff line change 5
5
if _sys .version_info < (3 , 10 ):
6
6
raise ImportError ("truststore requires Python 3.10 or later" )
7
7
8
+ # Detect Python runtimes which don't implement SSLObject.get_unverified_chain() API
9
+ # This API only became public in Python 3.13 but was available in CPython and PyPy since 3.10.
10
+ if _sys .version_info < (3 , 13 ):
11
+ try :
12
+ import ssl as _ssl
13
+ except ImportError :
14
+ raise ImportError ("truststore requires the 'ssl' module" )
15
+ else :
16
+ _sslmem = _ssl .MemoryBIO ()
17
+ _sslobj = _ssl .create_default_context ().wrap_bio (
18
+ _sslmem ,
19
+ _sslmem ,
20
+ )
21
+ try :
22
+ while not hasattr (_sslobj , "get_unverified_chain" ):
23
+ _sslobj = _sslobj ._sslobj # type: ignore[attr-defined]
24
+ except AttributeError :
25
+ raise ImportError (
26
+ "truststore requires peer certificate chain APIs to be available"
27
+ ) from None
28
+
29
+ del _ssl , _sslobj , _sslmem # noqa: F821
30
+
8
31
from ._api import SSLContext , extract_from_ssl , inject_into_ssl # noqa: E402
9
32
10
33
del _api , _sys # type: ignore[name-defined] # noqa: F821
11
34
12
35
__all__ = ["SSLContext" , "inject_into_ssl" , "extract_from_ssl" ]
13
- __version__ = "0.9.1 "
36
+ __version__ = "0.9.2 "
Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ rich==13.7.1
15
15
resolvelib==1.0.1
16
16
setuptools==70.3.0
17
17
tomli==2.0.1
18
- truststore==0.9.1
18
+ truststore==0.9.2
You can’t perform that action at this time.
0 commit comments