Skip to content
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

stdlib/Sockets: getaddrinfo("☃.net") non-ASCII hostname (RFC 3492) #26551

Closed
samoconnor opened this issue Mar 21, 2018 · 4 comments
Closed

Comments

@samoconnor
Copy link
Contributor

samoconnor commented Mar 21, 2018

function getalladdrinfo(host::String)
isascii(host) || error("non-ASCII hostname: $host")

Should this changed be to isascii(host) || host = Punycoder.encode(host) ?

References:
https://www.ietf.org/rfc/rfc3492.txt
JuliaWeb/URIParser.jl#9
http://☃.net

@vtjnash
Copy link
Member

vtjnash commented Mar 21, 2018

Seems vaguely like something that should be handled at the application-level (URIParser.jl? HTTP.jl? higher?), and not in the stdlib.

@samoconnor
Copy link
Contributor Author

samoconnor commented Mar 21, 2018

I'm not familiar with this in practice, just noticed this as a loose end in the URIParser.jl issues.
However, it seems like "Internationalized Domain Names in Applications (IDNA): Protocol" https://tools.ietf.org/html/rfc5891, is a well defined thing. It says DNS lookup of non-ascii names should be done by converting to punycode (an "A-label" in the language of the RFC).

5.6.  DNS Name Resolution

The A-label resulting from the conversion in Section 5.5 or supplied
directly (see Section 5.3) is combined with other labels as needed to
form a fully-qualified domain name that is then looked up in the DNS,
using normal DNS resolver procedures.  The lookup can obviously
either succeed (returning information) or fail.

Doing this in stdlib/Sockets might be a simple way to help all Julia systems to be IDNA compatible.

@inkydragon
Copy link
Member

upstream libuv has already supported non-ASCII hostname.

so, just remove this line and getaddrinfo("☃.net") works fine.

isascii(host) || error("non-ASCII hostname: $host")

@vtjnash vtjnash mentioned this issue Nov 28, 2018
@inkydragon
Copy link
Member

using Sockets; getaddrinfo("☃.net") works fine on Julia 1.6.3/1.7.0-rc1.

This issue can be closed now.

@quinnj quinnj closed this as completed Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants