8000 feat: ca_certs option (#168) · etherscan-io/sentry-python@3ab6d78 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ab6d78

Browse files
authored
feat: ca_certs option (getsentry#168)
1 parent 525350e commit 3ab6d78

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sentry_sdk/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"before_breadcrumb": None,
2828
"debug": False,
2929
"attach_stacktrace": False,
30+
"ca_certs": None,
3031
}
3132

3233

sentry_sdk/transport.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
from urllib import getproxies
1919

2020

21-
def _make_pool(parsed_dsn, http_proxy, https_proxy):
21+
def _make_pool(parsed_dsn, http_proxy, https_proxy, ca_certs):
2222
proxy = https_proxy if parsed_dsn == "https" else http_proxy
2323
if not proxy:
2424
proxy = getproxies().get(parsed_dsn.scheme)
2525

26-
opts = {"num_pools": 2, "cert_reqs": "CERT_REQUIRED", "ca_certs": certifi.where()}
26+
opts = {
27+
"num_pools": 2,
28+
"cert_reqs": "CERT_REQUIRED",
29+
"ca_certs": ca_certs or certifi.where(),
30+
}
2731

2832
if proxy:
2933
return urllib3.ProxyManager(proxy, **opts)
@@ -89,6 +93,7 @@ def __init__(self, options):
8993
self.parsed_dsn,
9094
http_proxy=options["http_proxy"],
9195
https_proxy=options["https_proxy"],
96+
ca_certs=options["ca_certs"],
9297
)
9398
self._disabled_until = None
9499
self._retry = urllib3.util.Retry()

0 commit comments

Comments
 (0)
0