From f789d2905bf9410ce372ff8c3dd8549534c4603d Mon Sep 17 00:00:00 2001 From: justinpolygon <123573436+justinpolygon@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:12:41 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"Use=20ssl=5Fcontext=20for=20HTTPS=20r?= =?UTF-8?q?equests=20to=20avoid=20reading=20certificate=20files=E2=80=A6"?= =?UTF-8?q?=20(#691)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7cb520843437dea4804e10dcb5457ab21c40f847. --- polygon/rest/base.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/polygon/rest/base.py b/polygon/rest/base.py index 3a5d637f..d9d4768a 100644 --- a/polygon/rest/base.py +++ b/polygon/rest/base.py @@ -1,6 +1,5 @@ import certifi import json -import ssl import urllib3 import inspect from urllib3.util.retry import Retry @@ -67,16 +66,13 @@ def __init__( backoff_factor=0.1, # [0.0s, 0.2s, 0.4s, 0.8s, 1.6s, ...] ) - # global cache ssl context and use (vs on each init of pool manager) - ssl_context = ssl.create_default_context() - ssl_context.load_verify_locations(certifi.where()) - # https://urllib3.readthedocs.io/en/stable/reference/urllib3.poolmanager.html # https://urllib3.readthedocs.io/en/stable/reference/urllib3.connectionpool.html#urllib3.HTTPConnectionPool self.client = urllib3.PoolManager( num_pools=num_pools, headers=self.headers, # default headers sent with each request. - ssl_context=ssl_context, + ca_certs=certifi.where(), + cert_reqs="CERT_REQUIRED", retries=retry_strategy, # use the customized Retry instance )