RFR: JDK-8261969: SNIHostName would check if the encoded hostname conform to RFC 3490

Rajan Halade rhalade at openjdk.java.net
Mon Feb 22 16:20:43 UTC 2021


On Fri, 19 Feb 2021 08:39:23 GMT, John Jiang <jjiang at openjdk.org> wrote:

> Similar to the constructor SNIHostName(String hostname), the constructor SNIHostName(byte[] encoded) also needs to check if the encoded hostname conform to RFC 3490.

Changes requested by rhalade (Reviewer).

test/jdk/javax/net/ssl/ServerName/IllegalSNIName.java line 40:

> 38:         try {
> 39:             new SNIHostName(hostname);
> 40:             throw new Exception("Expected to get IllegalArgumentException for "

Suggestion:

            throw new RuntimeException("Expected to get IllegalArgumentException for "

test/jdk/javax/net/ssl/ServerName/IllegalSNIName.java line 50:

> 48:         try {
> 49:             new SNIHostName(encodedHostname);
> 50:             throw new Exception("Expected to get IllegalArgumentException for "

Suggestion:

            throw new RuntimeException("Expected to get IllegalArgumentException for "

-------------

PR: https://git.openjdk.java.net/jdk/pull/2639



More information about the security-dev mailing list