From be08222eae882c90b632ce0851c2eb696df2465f Mon Sep 17 00:00:00 2001 From: mckirk Date: Tue, 8 Jul 2025 00:52:33 +0200 Subject: [PATCH] Replace SSLContext reference kept in botocore.httpsession --- src/truststore/_api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/truststore/_api.py b/src/truststore/_api.py index 47b7a63..1d838fe 100644 --- a/src/truststore/_api.py +++ b/src/truststore/_api.py @@ -60,6 +60,14 @@ def inject_into_ssl() -> None: except ImportError: pass + # replace reference kept by botocore as well + try: + import botocore.httpsession + + setattr(botocore.httpsession, "SSLContext", SSLContext) + except ImportError: + pass + def extract_from_ssl() -> None: """Restores the :class:`ssl.SSLContext` class to its original state"""