aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/certifi
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/python/certifi
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/python/certifi')
-rw-r--r--library/python/certifi/.dist-info/METADATA2
-rw-r--r--library/python/certifi/.dist-info/top_level.txt1
-rw-r--r--library/python/certifi/README.md7
-rw-r--r--library/python/certifi/certifi/__init__.py10
-rw-r--r--library/python/certifi/certifi/binary.py25
-rw-r--r--library/python/certifi/certifi/source.py13
-rw-r--r--library/python/certifi/ya.make18
7 files changed, 76 insertions, 0 deletions
diff --git a/library/python/certifi/.dist-info/METADATA b/library/python/certifi/.dist-info/METADATA
new file mode 100644
index 0000000000..4849f81ed4
--- /dev/null
+++ b/library/python/certifi/.dist-info/METADATA
@@ -0,0 +1,2 @@
+Name: certifi
+Version: 2019.7.1
diff --git a/library/python/certifi/.dist-info/top_level.txt b/library/python/certifi/.dist-info/top_level.txt
new file mode 100644
index 0000000000..963eac530b
--- /dev/null
+++ b/library/python/certifi/.dist-info/top_level.txt
@@ -0,0 +1 @@
+certifi
diff --git a/library/python/certifi/README.md b/library/python/certifi/README.md
new file mode 100644
index 0000000000..75a812733c
--- /dev/null
+++ b/library/python/certifi/README.md
@@ -0,0 +1,7 @@
+This library provides arcadia certs via certifi-compatible API.
+
+In binary (single executable) mode it patches python ssl module to
+support loading certs from memory.
+
+.dist-info/METADATA version reflects the last update time of the
+arcadia certs.
diff --git a/library/python/certifi/certifi/__init__.py b/library/python/certifi/certifi/__init__.py
new file mode 100644
index 0000000000..5270d206cd
--- /dev/null
+++ b/library/python/certifi/certifi/__init__.py
@@ -0,0 +1,10 @@
+import ssl
+
+if hasattr(ssl, 'builtin_cadata'):
+ from .binary import where
+else:
+ from .source import where
+
+__all__ = ['where', '__version__']
+
+__version__ = '2020.04.05.2'
diff --git a/library/python/certifi/certifi/binary.py b/library/python/certifi/certifi/binary.py
new file mode 100644
index 0000000000..1050e733a3
--- /dev/null
+++ b/library/python/certifi/certifi/binary.py
@@ -0,0 +1,25 @@
+import ssl
+
+
+def builtin_ca():
+ return None, None, ssl.builtin_cadata()
+
+
+# Normally certifi.where() returns a path to a certificate file;
+# here it returns a callable.
+def where():
+ return builtin_ca
+
+
+# Patch ssl module to accept a callable cafile.
+load_verify_locations = ssl.SSLContext.load_verify_locations
+
+
+def load_verify_locations__callable(self, cafile=None, capath=None, cadata=None):
+ if callable(cafile):
+ cafile, capath, cadata = cafile()
+
+ return load_verify_locations(self, cafile, capath, cadata)
+
+
+ssl.SSLContext.load_verify_locations = load_verify_locations__callable
diff --git a/library/python/certifi/certifi/source.py b/library/python/certifi/certifi/source.py
new file mode 100644
index 0000000000..f539b67002
--- /dev/null
+++ b/library/python/certifi/certifi/source.py
@@ -0,0 +1,13 @@
+import os.path
+
+pem = os.path.abspath(__file__)
+pem = os.path.dirname(pem)
+pem = os.path.dirname(pem)
+pem = os.path.dirname(pem)
+pem = os.path.dirname(pem)
+pem = os.path.dirname(pem)
+pem = os.path.join(pem, 'certs', 'cacert.pem')
+
+
+def where():
+ return pem
diff --git a/library/python/certifi/ya.make b/library/python/certifi/ya.make
new file mode 100644
index 0000000000..64fefe2833
--- /dev/null
+++ b/library/python/certifi/ya.make
@@ -0,0 +1,18 @@
+PY23_LIBRARY()
+
+OWNER(orivej g:python-contrib)
+
+RESOURCE_FILES(
+ PREFIX library/python/certifi/
+ .dist-info/METADATA
+ .dist-info/top_level.txt
+)
+
+PY_SRCS(
+ TOP_LEVEL
+ certifi/__init__.py
+ certifi/binary.py
+ certifi/source.py
+)
+
+END()