-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idna is dissatisfied with underscores #17
Comments
Underscores are not legal in IDNs (or, for that matter, ASCII domain names that follow hostname rules which most domain registries apply). There are certain circumstances where they are legal but not as it pertains to IDNs. Specifically, see http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml under "IDNA Derived Properties", U+003A-U+0060 are DISALLOWED. See also https://tools.ietf.org/html/rfc5890#section-2.3.1 for further discussion. There may be an idea to add a "less strict" flag (i.e. non-STD 3 rules) to the idna library such that if it received a string that is pure ASCII, it doesn't throw an exception if it is not LDH. |
@kjd Maybe you could help enlighten me a bit? It seems the point I'm dying at is ssl verification through twisted. Should a hostname like foo_bar.baz.com never be a valid hostname? Or should it just never be passed to idna encoding since underscore is a valid ascii character? That is, underscores appear to be valid in ascii hostnames, but that conflicts with IDNs in some way? |
Underscores are not valid in ASCII hostnames, and never were. That fact has nothing to do with IDNA. Only letters, digits and hyphen are valid. See RFC 952 for details. |
@jribbens Awesome, I see now, thanks! "While a hostname may not contain other characters, such as the underscore character (_), other DNS names may contain the underscore" looks like that's more or less where my confusion lies. I'll close this ticket. Thanks for the weigh in guys! This wasn't my area of expertise. : ) |
* Add MAC vendor lookup for device_tracker. * Test vendor mac lookup and fix device attribute. * Generate requirements. * Style. * Use hyphen instead of underscore to satisfy 'idna'. kjd/idna#17 * Resort imports. * Refactor macvendor to use macvendors.com API instead of netaddr library. * Test vendor lookup using macvendors.com api. * Remove debugging. * Correct description. * No longer needed. * Device tracker is now an async component. Fix ddwrt tests. * Fix linting. * Add test case for error conditions. * There is no reason to retry failes vendor loopups as they won't be saved to the file anyways at that point. * Sorry, bad assumption, this only made things worse. * Wait for async parts during setup component to complete before asserting results. * Fix linting. * Is generated when running 'coverage html'. * Undo isort. * Make aioclient_mock exception more generic. * Only lookup mac vendor string with adding new device to known_devices.yaml. * Undo isort. * Revert unneeded change. * Adjust to use new websession pattern. * Always make sure to cleanup response. * Use correct function to release response. * Fix tests.
Seems like underscores in hostname should be perfectly allowed? Can't find any RFC that suggests otherwise (and browsers seem happy with URLs in hostname).
Perhaps this is more of a twisted bug where it shouldn't pass this sort of url to idna ever, not sure. This is just an issue I hit as an end user
The text was updated successfully, but these errors were encountered: