Support for Proxy Authentication
See original GitHub issueHi there! Thanks for all you do with Sentry – it adds incredible value to our team.
I have a question about support for HTTP proxy authentication in sentry_sdk
.
TL;DR: Is proxy authentication supported? If not, can it be? Without support for proxy auth, we can’t use Sentry from a significant portion of our services.
More details:
I see that we can pass a https_proxy
kwarg to sentry_sdk.init()
, such as:
sentry_sdk.init("https://...@foo.ingest.sentry.io/...", https_proxy="http://user:pass@proxy")
However, it looks like that proxy string eventually gets passed to urllib3.ProxyManager()
here: https://github.com/getsentry/sentry-python/blob/0da369f839ee2c383659c91ea8858abcac04b869/sentry_sdk/transport.py#L293
Unfortunately, urllib3.ProxyManager
does not appear to respect credentials passed in this string. The documentation isn’t super clear on this, but it does allude to it in the description of the proxy_headers
kwarg: “Could be used for proxy authentication.” We verified with packet captures that urllib3.ProxyManager
is not adding a Proxy-Authorization
HTTP header to requests when the proxy string includes credentials.
Thanks so much for your consideration and help with this!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thanks for the fast reply @sl0thentr0py!
An upstream solution sounds like the best way to solve this!
Found urllib3/urllib3#1999 which proposes to add
Proxy-Authorization
headers using credentials extracted from the URL.@keimlink imo this should be supported upstream in urllib3’s ProxyManager then, sentry is just passing through the url