Async or Sync Client Verify with SSLContext Failing due to cert param not set #2767
Unanswered
jiaulislam
asked this question in
Q&A
Replies: 1 comment
-
I'd expect this too yeah. I'm unclear from your description exactly what the behaviour is here, but it's actually a pointer to an API issue that I've had on my (internal) radar for a while... A sharper API here would be: response = httpx.get(..., ssl_context=...) With a gentle migration path / requests-ish compat of: ssl_context = httpx.SSLContext(verify=..., cert=..., trust_env=..., http2=...)
response = httpx.get(..., ssl_context=ssl_context) There's a bit of design work that'd be needed around that, but it's just neater to not have the weird overloading of the For instance... # See https://truststore.readthedocs.io/en/latest/
ssl_context = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
client = httpx.Client(ssl_context=ssl_context) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to connect an API with SSL context as below. But when using the
Async Client or Sync Client
I have to provide cert parameter again to be able to call successfully the API if not provided getting error.Python Version: 3.11.1
httpx Version: 0.24.1
Expected Behavior:
As the SSL Context already have the SSL configs with the Certs, I expected I don't need to pass the certs parameter value in the
Async or Sync Client
Actual Behavior:
Getting Error if certs params not given with actual cert files. Error details:
[SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:1002)
.Do I really have to pass the certs params again or is there any other way it can be resolved ?
Thanks in Advance
Beta Was this translation helpful? Give feedback.
All reactions