summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <[email protected]>2026-03-11 07:05:54 +0300
committerrobot-piglet <[email protected]>2026-03-11 07:51:34 +0300
commit30e75adce65edfaf782ffdaf713dd0931e58fc83 (patch)
tree5835aa905f9e0db2e1c667349d54b849403100e5 /contrib/tools/python3
parent720d7c08939c495a6c6bea8ed6db5d22a4362570 (diff)
Prefer CA bundle set by SSL_CERT_FILE and SSL_CERT_DIR (common part)
- **library/cpp/openssl: prefer CA set by SSL_CERT_FILE and SSL_CERT_DIR** - **contrib/tools/python3: prefer CA set by SSL_CERT_FILE and SSL_CERT_DIR** - **library/python/certifi: prefer CA set by SSL_CERT_FILE and SSL_CERT_DIR** First three commits from PR #1607 to change common part separately. --- Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1635 Co-authored-by: shadchin <[email protected]> Co-authored-by: shadchin <[email protected]> commit_hash:21db0cd5fe3b4af267dcf5ec4d2753fbdd49ba1e
Diffstat (limited to 'contrib/tools/python3')
-rw-r--r--contrib/tools/python3/Lib/ssl.py3
-rw-r--r--contrib/tools/python3/patches/embed-builtin-cadata.patch5
2 files changed, 5 insertions, 3 deletions
diff --git a/contrib/tools/python3/Lib/ssl.py b/contrib/tools/python3/Lib/ssl.py
index d976ce7b91a..75ea6a8155f 100644
--- a/contrib/tools/python3/Lib/ssl.py
+++ b/contrib/tools/python3/Lib/ssl.py
@@ -543,7 +543,8 @@ class SSLContext(_SSLContext):
if not isinstance(purpose, _ASN1Object):
raise TypeError(purpose)
- self.load_verify_locations(cadata=builtin_cadata())
+ if os.getenv("SSL_CERT_FILE") is None and os.getenv("SSL_CERT_DIR") is None:
+ self.load_verify_locations(cadata=builtin_cadata())
if sys.platform == "win32":
for storename in self._windows_cert_stores:
diff --git a/contrib/tools/python3/patches/embed-builtin-cadata.patch b/contrib/tools/python3/patches/embed-builtin-cadata.patch
index adcee60660d..af6d8a7d1e3 100644
--- a/contrib/tools/python3/patches/embed-builtin-cadata.patch
+++ b/contrib/tools/python3/patches/embed-builtin-cadata.patch
@@ -47,12 +47,13 @@ revision: 5191643
class SSLContext(_SSLContext):
"""An SSLContext holds various SSL-related configuration options and
data, such as certificates and possibly a private key."""
-@@ -591,6 +605,9 @@ class SSLContext(_SSLContext):
+@@ -591,6 +605,10 @@ class SSLContext(_SSLContext):
def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
if not isinstance(purpose, _ASN1Object):
raise TypeError(purpose)
+
-+ self.load_verify_locations(cadata=builtin_cadata())
++ if os.getenv("SSL_CERT_FILE") is None and os.getenv("SSL_CERT_DIR") is None:
++ self.load_verify_locations(cadata=builtin_cadata())
+
if sys.platform == "win32":
for storename in self._windows_cert_stores: