"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient5/src/test/java/org/apache/hc/client5/http/ssl/TestDefaultHostnameVerifier.java" between
httpcomponents-client-5.2-src.tar.gz and httpcomponents-client-5.2.1-src.tar.gz

About: Apache HttpComponents Client provides reusable components for client-side authentication, HTTP state management, and HTTP connection management. Java sources.

TestDefaultHostnameVerifier.java  (httpcomponents-client-5.2-src):TestDefaultHostnameVerifier.java  (httpcomponents-client-5.2.1-src)
skipping to change at line 257 skipping to change at line 257
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.go v.uk", "a*.gov.uk", publicSuffixMatcher)); // Bad 2TLD Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.go v.uk", "a*.gov.uk", publicSuffixMatcher)); // Bad 2TLD
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("s.a.gov.uk ", "a*.gov.uk", publicSuffixMatcher)); // Bad 2TLD Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("s.a.gov.uk ", "a*.gov.uk", publicSuffixMatcher)); // Bad 2TLD
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("s.a. gov.uk", "a*.gov.uk", publicSuffixMatcher)); // Bad 2TLD/no subdomain allowed Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("s.a. gov.uk", "a*.gov.uk", publicSuffixMatcher)); // Bad 2TLD/no subdomain allowed
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("a.b.c", "* .b.*")); Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("a.b.c", "* .b.*"));
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.b. c", "*.b.*")); Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.b. c", "*.b.*"));
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("a.b.c", "* .*.c")); Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("a.b.c", "* .*.c"));
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.b. c", "*.*.c")); Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.b. c", "*.*.c"));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("a.b.xxx.uk"
, "a.b.xxx.uk", publicSuffixMatcher));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentityStrict("a.b.x
xx.uk", "a.b.xxx.uk", publicSuffixMatcher));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("a.b.xxx.uk"
, "*.b.xxx.uk", publicSuffixMatcher));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentityStrict("a.b.x
xx.uk", "*.b.xxx.uk", publicSuffixMatcher));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("b.xxx.uk",
"b.xxx.uk", publicSuffixMatcher));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentityStrict("b.xxx
.uk", "b.xxx.uk", publicSuffixMatcher));
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentity("b.xxx.uk",
"*.xxx.uk", publicSuffixMatcher));
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("b.xx
x.uk", "*.xxx.uk", publicSuffixMatcher));
} }
@Test @Test
public void testHTTPCLIENT_1097() { public void testHTTPCLIENT_1097() {
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("a.b.c", "a* .b.c")); Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("a.b.c", "a* .b.c"));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentityStrict("a.b.c ", "a*.b.c")); Assertions.assertTrue(DefaultHostnameVerifier.matchIdentityStrict("a.b.c ", "a*.b.c"));
Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("a.a.b.c", " a*.b.c")); Assertions.assertTrue(DefaultHostnameVerifier.matchIdentity("a.a.b.c", " a*.b.c"));
Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.a. b.c", "a*.b.c")); Assertions.assertFalse(DefaultHostnameVerifier.matchIdentityStrict("a.a. b.c", "a*.b.c"));
} }
skipping to change at line 429 skipping to change at line 441
DefaultHostnameVerifier.matchDNSName( DefaultHostnameVerifier.matchDNSName(
"hostname-workspace-1.local", "hostname-workspace-1.local",
Collections.singletonList(SubjectName.DNS("hostname-workspace-1. local")), Collections.singletonList(SubjectName.DNS("hostname-workspace-1. local")),
publicSuffixMatcher); publicSuffixMatcher);
Assertions.assertThrows(SSLException.class, () -> Assertions.assertThrows(SSLException.class, () ->
DefaultHostnameVerifier.matchDNSName( DefaultHostnameVerifier.matchDNSName(
"host.domain.com", "host.domain.com",
Collections.singletonList(SubjectName.DNS("some.other.co m")), Collections.singletonList(SubjectName.DNS("some.other.co m")),
publicSuffixMatcher)); publicSuffixMatcher));
DefaultHostnameVerifier.matchDNSName(
"host.ec2.compute-1.amazonaws.com",
Collections.singletonList(SubjectName.DNS("host.ec2.compute-1.am
azonaws.com")),
publicSuffixMatcher);
DefaultHostnameVerifier.matchDNSName(
"host.ec2.compute-1.amazonaws.com",
Collections.singletonList(SubjectName.DNS("*.ec2.compute-1.amazo
naws.com")),
publicSuffixMatcher);
DefaultHostnameVerifier.matchDNSName(
"ec2.compute-1.amazonaws.com",
Collections.singletonList(SubjectName.DNS("ec2.compute-1.amazona
ws.com")),
publicSuffixMatcher);
Assertions.assertThrows(SSLException.class, () ->
DefaultHostnameVerifier.matchDNSName(
"ec2.compute-1.amazonaws.com",
Collections.singletonList(SubjectName.DNS("*.compute-1.a
mazonaws.com")),
publicSuffixMatcher));
} }
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)