python-trio / python-trio/trio
trio.ssl handling for Unicode (IDNA) domains is deeply broken
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
trio.ssl relies on the stdlib ssl module for hostname checking. Unfortunately, when it comes to non-ASCII domain names, it's totally broken. Which means that trio.ssl is also totally broken. In other ways, trio handles IDNA well (better than the stdlib). But this is hard to work around.
We don't have a lot of great options here. We could:
-
Substantially rewrite
trio.sslto use PyOpenSSL instead. But this requires adding a bunch of tricky code, and also would break our API. (We currently take a stdlibssl.SSLContextobject as input, and it's impossible to read the SNI callback and other critical attributes off of anssl.SSLContextobject, which means that it's impossible to correctly convert a stdlibSSLContextinto a PyOpenSSL equivalent. See bpo-32359.) -
Hope that upstream
sslgets better, or fix it ourselves. Not impossible, but maybe not a thing to hold our breath on either. -
Hope that PEP 543 comes along and saves us.
-
....?
I'm not sure what to do, but at least now we have a bug to track the problem...
Original text:
IDNA support in trio.socket
Help I have no idea what I'm doing here.
Probably also touches on TLS support, #9.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the trio.ssl and trio.socket handling described in this issue, then review the linked stdlib ssl and PEP 543 discussions. Compare the PyOpenSSL, upstream ssl, and API-compatibility options; the work is done when Unicode IDNA hostname checking is correct without breaking the existing SSLContext API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100