Trio backend does not report TLS errors #3674
Unanswered
pquentin
asked this question in
Potential Issue
Replies: 1 comment
-
Heya @pquentin, really good to hear from you. 😄 Thanks for the sensibly neat report. Okay, so
I've considered opening an issue with except (_stdlib_ssl.SSLError, _stdlib_ssl.CertificateError) as exc:
self._state = _State.BROKEN
raise trio.BrokenResourceError from exc The class does document that Options here...
Either of those would resolve the issue as you've stated it. (?) Overall tho there's also a bit of a gap between the user experience of...
...vs the browser experience... ![]() |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following script:
Since my Python/OpenSSL distribution rightfully doesn't support TLS 1.0, the connection fails as expected. But I'm only getting a generic
ConnectError
without a clear reason. When using asyncio, the reason is attached to theConnectError
:[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1032)
.Traceback with Trio
Traceback with asyncio
Why is that? While asyncio raises the SSLError directly, Trio wraps it into a
BrokenResourceError
, and the message is only in the nestedSSLError
. For this reason, the current exception map approach doesn't work. Note that the fix applied to AnyIO last year won't help here, as AnyIO, just like asyncio, raises theSSLError
exception directly.Finally, in case it's helpful, here are my experiments using Trio and AnyIO directly:
Using Trio directly
Using AnyIO directly
Happy to open an httpcore issue if this is considered a valid problem.
Beta Was this translation helpful? Give feedback.
All reactions