Skip to content

Commit f789d29

Browse files
authoredJul 2, 2024··
Revert "Use ssl_context for HTTPS requests to avoid reading certificate files…" (#691)
This reverts commit 7cb5208.
1 parent 479cca3 commit f789d29

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed
 

‎polygon/rest/base.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import certifi
22
import json
3-
import ssl
43
import urllib3
54
import inspect
65
from urllib3.util.retry import Retry
@@ -67,16 +66,13 @@ def __init__(
6766
backoff_factor=0.1, # [0.0s, 0.2s, 0.4s, 0.8s, 1.6s, ...]
6867
)
6968

70-
# global cache ssl context and use (vs on each init of pool manager)
71-
ssl_context = ssl.create_default_context()
72-
ssl_context.load_verify_locations(certifi.where())
73-
7469
# https://urllib3.readthedocs.io/en/stable/reference/urllib3.poolmanager.html
7570
# https://urllib3.readthedocs.io/en/stable/reference/urllib3.connectionpool.html#urllib3.HTTPConnectionPool
7671
self.client = urllib3.PoolManager(
7772
num_pools=num_pools,
7873
headers=self.headers, # default headers sent with each request.
79-
ssl_context=ssl_context,
74+
ca_certs=certifi.where(),
75+
cert_reqs="CERT_REQUIRED",
8076
retries=retry_strategy, # use the customized Retry instance
8177
)
8278

0 commit comments

Comments
 (0)
Please sign in to comment.