diff options
author | Alex Klyubin <klyubin@google.com> | 2014-11-19 00:50:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-19 00:50:46 +0000 |
commit | d910cf339d61153d66f9a3d835eff027791ad78c (patch) | |
tree | fddcd09681c8b2e174d96a1e1825e543454127e2 | |
parent | be5e80e21d4b06d72b30b78ed195fe557a0b687c (diff) | |
parent | fc3d4de60de1465b8826cbdf2fc4b894bb3054d7 (diff) | |
download | libcore-d910cf339d61153d66f9a3d835eff027791ad78c.zip libcore-d910cf339d61153d66f9a3d835eff027791ad78c.tar.gz libcore-d910cf339d61153d66f9a3d835eff027791ad78c.tar.bz2 |
Merge "Fix DefaultHostnameVerifierTest failure."
-rw-r--r-- | luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java b/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java index 71ccea4..e890355 100644 --- a/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java +++ b/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java @@ -154,9 +154,11 @@ public final class DefaultHostnameVerifierTest extends TestCase { assertFalse(verifier.verifyHostName("imap.google.com", "ix*.google.com")); assertTrue(verifier.verifyHostName("imap.google.com", "iMap.Google.Com")); assertTrue(verifier.verifyHostName("weird", "weird")); + assertFalse(verifier.verifyHostName("weird", "weird.")); + + // Wildcards rejected for domain names consisting of fewer than two labels (excluding root). assertFalse(verifier.verifyHostName("weird", "weird*")); assertFalse(verifier.verifyHostName("weird", "*weird")); - assertFalse(verifier.verifyHostName("weird", "weird.")); assertFalse(verifier.verifyHostName("weird", "weird*.")); assertFalse(verifier.verifyHostName("weird", "weird.*")); } @@ -175,10 +177,12 @@ public final class DefaultHostnameVerifierTest extends TestCase { assertFalse(verifier.verifyHostName("imap.google.com.", "ix*.google.com")); assertTrue(verifier.verifyHostName("imap.google.com.", "iMap.Google.Com")); assertTrue(verifier.verifyHostName("weird.", "weird")); - assertTrue(verifier.verifyHostName("weird.", "weird*")); - assertTrue(verifier.verifyHostName("weird.", "*weird")); assertTrue(verifier.verifyHostName("weird.", "weird.")); - assertTrue(verifier.verifyHostName("weird.", "weird*.")); + + // Wildcards rejected for domain names consisting of fewer than two labels (excluding root). + assertFalse(verifier.verifyHostName("weird.", "*weird")); + assertFalse(verifier.verifyHostName("weird.", "weird*")); + assertFalse(verifier.verifyHostName("weird.", "weird*.")); assertFalse(verifier.verifyHostName("weird.", "weird.*")); } |