element-hq / element-hq/synapse
not all punycode-encoded domains work
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#8991](https://github.com/matrix-org/synapse/issues/8991).
---
### Description
If you have a domain with only emoji and want to set your server_name to the punycode-encoded versoin of it (e.g. `xn--9s9hnf.ws`) the server is not able to federate.
This is because twisted.web.client uses the python package idna over [here](https://github.com/twisted/twisted/blob/c8064075a207af1fc9ce19d8f885a986bc5ab00c/src/twisted/internet/_idna.py#L51) to check if a domain is valid. Editing that to use `text.encode("idna")` and `text.decode("idna")` fixes this issue.
Said idna package has an issue [here](https://github.com/kjd/idna/issues/18) about not supporting emoji domains, and from the sounds of it they do not plan to add it.
Soru would open this issue with the twisted package, but she couldn't find any way to open non-security-critical bug reports with them. This issue also affects synapse as, well, that does not allow you to have all punycode-encoded domains as your server_name, even though they are valid according to the spec etc.
Contributor guide
Assessment
This issue has not been assessed yet.