michael-o commented on a change in pull request #203: HTTPCLIENT-2047: fixed 
regression in DefaultHostnameVerifier
URL: 
https://github.com/apache/httpcomponents-client/pull/203#discussion_r370992772
 
 

 ##########
 File path: 
httpclient/src/test/java/org/apache/http/conn/ssl/TestDefaultHostnameVerifier.java
 ##########
 @@ -417,4 +419,28 @@ public void testExtractCN() throws Exception {
         }
     }
 
+    @Test
+    public void testMatchDNSName() throws Exception {
+        DefaultHostnameVerifier.matchDNSName(
+                "host.domain.com",
+                Collections.singletonList(SubjectName.DNS("*.domain.com")),
+                publicSuffixMatcher);
+        DefaultHostnameVerifier.matchDNSName(
+                "host.xx",
+                Collections.singletonList(SubjectName.DNS("*.xx")),
+                publicSuffixMatcher);
+        DefaultHostnameVerifier.matchDNSName(
+                "host.appspot.com",
+                Collections.singletonList(SubjectName.DNS("*.appspot.com")),
+                publicSuffixMatcher);
+        DefaultHostnameVerifier.matchDNSName(
+                "demo-s3-bucket.s3.eu-central-1.amazonaws.com",
+                
Collections.singletonList(SubjectName.DNS("*.s3.eu-central-1.amazonaws.com")),
+                publicSuffixMatcher);
+        DefaultHostnameVerifier.matchDNSName(
+                "hostname-workspace-1.ops.domain.local",
+                
Collections.singletonList(SubjectName.DNS("hostname-workspace-1.ops.domain.local")),
 
 Review comment:
   I agree that the matching logic should work, but I don't think we should use 
something forbidden in our tests. `hostname-workspace-1-ops.local` should do, 
shouldn't it for the tests?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to