Merge "Fix DefaultHostnameVerifierTest failure."
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 @@
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 @@
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.*"));
}