<div dir="ltr">Dear Michael,<br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 10:24 PM Michael Casadevall <<a href="mailto:michael@casadevall.pro" target="_blank">michael@casadevall.pro</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So, here is a question for the list: Where in the stack should IDN/EAI<br>
translation happen? Should it happen in the user application, or lower<br>
in the stack such as the core libraries that handle things like TLS<br>
connections?<br></blockquote><div>... </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>This leads library makers and applications to handle IDNs manually,<br>
which in the case of Python, if they made a mistake can lead to the<br>
above error, namely blowing up Python. Now, in practice, OpenSSL not<br>
directly supporting IDNs seems to have relatively little effect on its<br>
own. After taking a very deep dive through the RFCs, it appears that in<br>
all relevant places, everything relating to web TLS certificates takes<br>
EAI5Address encoding and thus requires punycode representation. However,<br>
as I’ve just shown, there are obviously places where things have fallen<br>
through the cracks and I think it warrants a deeper investigation.<br></blockquote><div><br></div><div>I think that error in IDN processing in OpenSSL itself can cause a lot of </div><div>bad consequences being worse than errors in any application using OpenSSL. </div><div>So I understand the position of OpenSSL Team when they do not want to implement such support here. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The thing is though, and just to reiterate the question, just where in<br>
the stack should IDN translation happen?<br>
<br>
In the above case, had OpenSSL supported IDNs directly, it would have<br>
prevented this bug in the first place. That being said, since TLS<br>
essentially only uses A-labels as far as I can tell, I can’t necessarily<br>
say it’s wrong that OpenSSL doesn’t support IDNs.  I think, though, this<br>
is an area which, in general, that needs more attention, especially if I<br>
can break a popular programming language with a trivial example.<br>
<br>
Thoughts and comments welcome,<br>
Michael<br>
<br>
<br>
* - there is one special case for wildcards<br>
</blockquote></div>In my (rather limited) practice I usually use A-labels for internal representation and<div>U-labels (or both) for external. Script languages, such as Python, Perl, PHP etc</div><div>usually provide wrappers for IDN converters so it's much simpler to do this conversion outside in applications.<div><div><br></div>-- <br><div dir="ltr" class="m_5431904941064977432gmail_signature" data-smartmail="gmail_signature">SY, Dmitry Belyavsky</div></div></div></div>