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 :  
Description
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
/java/re/jdk/8/latest/binaries/solaris-x64/bin/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)
slc00snz%

javax.net.ssl.SNIHostName use it and throw exception when hostname is non-ascii.
Comments
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.
29-08-2013

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.
26-08-2013

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.
16-08-2013

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

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.
22-07-2013