Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiohttp and zero trust ssl verification issue #430

Open
tjbaker opened this issue Jan 6, 2025 · 1 comment
Open

aiohttp and zero trust ssl verification issue #430

tjbaker opened this issue Jan 6, 2025 · 1 comment

Comments

@tjbaker
Copy link

tjbaker commented Jan 6, 2025

When one uses zero trust solutions like ZScaler or Netskope they act like a proxy and inject their own ssl certificate. This often results in ssl cert verification errors like

An error occurred: HTTPSConnectionPool(host='xxx.xxx.xxx', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)')))

The python requests library allows one to set an env variable for REQUESTS_CA_BUNDLE which it will load. You import the security vendor's root cert into certifi and point to it's truststore and the ssl verification succeeds.

I found a long bug thread for aiohttp discussing this, and they suggest ways to construct the sslContext for users of aiohttp to address this same concern without using ENV variables.

aio-libs/aiohttp#3180

The problem is that one can't do this when aiohttp is used in some other project...in this case the okta client.

I am unable to use the okta client and have to rewrite everything using the requests library...which I have working.

Is there a way to configure the okta client to be aware of custom certs and pass them to aiohttp appropriately?

@tjbaker tjbaker changed the title aiohttp and zscaler aiohttp and zero trust ssl verification issue Jan 6, 2025
@tjbaker
Copy link
Author

tjbaker commented Jan 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant