Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade truststore to 0.9.2 #12929

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/truststore.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade truststore to 0.9.2
25 changes: 24 additions & 1 deletion src/pip/_vendor/truststore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,32 @@
if _sys.version_info < (3, 10):
raise ImportError("truststore requires Python 3.10 or later")

# Detect Python runtimes which don't implement SSLObject.get_unverified_chain() API
# This API only became public in Python 3.13 but was available in CPython and PyPy since 3.10.
if _sys.version_info < (3, 13):
try:
import ssl as _ssl
except ImportError:
raise ImportError("truststore requires the 'ssl' module")
else:
_sslmem = _ssl.MemoryBIO()
_sslobj = _ssl.create_default_context().wrap_bio(
_sslmem,
_sslmem,
)
try:
while not hasattr(_sslobj, "get_unverified_chain"):
_sslobj = _sslobj._sslobj # type: ignore[attr-defined]
except AttributeError:
raise ImportError(
"truststore requires peer certificate chain APIs to be available"
) from None

del _ssl, _sslobj, _sslmem # noqa: F821

from ._api import SSLContext, extract_from_ssl, inject_into_ssl # noqa: E402

del _api, _sys # type: ignore[name-defined] # noqa: F821

__all__ = ["SSLContext", "inject_into_ssl", "extract_from_ssl"]
__version__ = "0.9.1"
__version__ = "0.9.2"
2 changes: 1 addition & 1 deletion src/pip/_vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ rich==13.7.1
resolvelib==1.0.1
setuptools==70.3.0
tomli==2.0.1
truststore==0.9.1
truststore==0.9.2