Skip to content

Commit 2a49fdf

Browse files
author
clickingbuttons
authored
add certifi (#155)
1 parent d7bff2d commit 2a49fdf

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

poetry.lock

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polygon/rest/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import certifi
22
import json
33
import urllib3
44
import inspect
@@ -33,6 +33,8 @@ def __init__(
3333
"Authorization": "Bearer " + self.API_KEY,
3434
"User-Agent": "Python client",
3535
},
36+
ca_certs=certifi.where(),
37+
cert_reqs="CERT_REQUIRED",
3638
)
3739
self.timeout = urllib3.Timeout(connect=connect_timeout, read=read_timeout)
3840
self.retries = retries
@@ -55,7 +57,10 @@ def _get(
5557
if self.verbose:
5658
print("_get", path, params)
5759
resp = self.client.request(
58-
"GET", self.BASE + path, fields=params, retries=self.retries
60+
"GET",
61+
self.BASE + path,
62+
fields=params,
63+
retries=self.retries,
5964
)
6065

6166
if resp.status != 200:

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ packages = [
2727
python = "^3.7"
2828
urllib3 = "^1.26.9"
2929
websockets = "^10.3"
30+
certifi = "^2021.10.8"
3031

3132
[tool.poetry.dev-dependencies]
3233
black = "^22.3.0"
@@ -37,6 +38,7 @@ Sphinx = "^4.5.0"
3738
sphinx-rtd-theme = "^1.0.0"
3839
# keep this in sync with docs/requirements.txt for readthedocs.org
3940
sphinx-autodoc-typehints = "^1.18.1"
41+
types-certifi = "^2021.10.8"
4042

4143
[build-system]
4244
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)