SSLCertVerificationError can be handled by RequestError #2682
Unanswered
nkhitrov
asked this question in
Potential Issue
Replies: 2 comments 8 replies
Where would you look first to answer this question? What other information do you have available that might help you resolve this? |
8 replies
|
This is a problem also because the behavior is different for
import httpx
import ssl
ssl_context = httpx.create_ssl_context(ssl.PROTOCOL_TLS)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2 | ssl.OP_NO_TLSv1_3
client = httpx.Client(verify=ssl_context)
client.get("https://www.howsmyssl.com/a/check")gives
import asyncio
import httpx
import ssl
ssl_context = httpx.create_ssl_context(ssl.PROTOCOL_TLS)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2 | ssl.OP_NO_TLSv1_3
client = httpx.AsyncClient(verify=ssl_context)
async def main():
await client.get("https://www.howsmyssl.com/a/check")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())gives |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I use the
AsyncClient.request()method to call one of the internal services. Today due to Kubernetes configuration error I gotSSLCertVerificationError.I was very surprised because there is a
RequestErrorexception handling in the code. The description of this error says that it can catch all possible errors:Why this ssl error is not handled in the same way as connection errors?
Maybe this behaviour should be changed?
All reactions