JDK-8019785 : Should not set IDN.USE_STD3_ASCII_RULES option in SNIHostName
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: internal,8
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2013-07-03
  • Updated: 2017-05-19
  • Resolved: 2013-08-29
Related Reports
Duplicate :  
Relates :  
Calling IDN.toASCII with non-ascii String arg. and IDN.USE_STD3_ASCII_RULES option is set.

Please try to run IDNTest.java attached.

slc00snz% which java
slc00snz% java IDNTest (non-ascii value such as ���������)
hostname = ���������
Exception in thread "main" java.lang.IllegalArgumentException: Contains
non-LDH characters
        at java.net.IDN.toASCIIInternal(IDN.java:275)
        at java.net.IDN.toASCII(IDN.java:118)
        at IDNTest.main(IDNTest.java:23)

javax.net.ssl.SNIHostName use it and throw exception when hostname is non-ascii.
The issue will be addressed in JDK-8023881. We may also want to use IDN.ALLOW_UNASSIGNED, but it does not sound like a critical requirement at present. We can do it on request later.

If IDN.USE_STD3_ASCII_RULES option is used, IDN will not allow non-ascii code. It is incorrectly used in SNIHostName. Need to update the spec of SNIHostName.

The exception means that the hostname in the test is not a legal name that following RFC 3490 and IDN.USE_STD3_ASCII_RULES. Close it as not a bug.

sqe info: GS-Tonga/SNITest/SNITest1 GS-Tonga/SNITest/SNITest2 GS-Tonga/SNITest/SNITest3 GS-Tonga/SNITest/SNITest4

Looks like this isn't an IDN bug as the class is doing what is intended when the flag is set. Maybe calling code shouldn't be setting it. So, I'll pass bug over to jsse to investigate.