Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2247

SSLPeerUnverifiedException on matching wildcard certificate (US20 amazon)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 4.5.13
    • None
    • HttpClient (classic)
    • None

    Description

      In version 4.5.13, the following code piece will throw SSLPeerUnverifiedException.  If the host change to "ec2.us-east-1.compute-1.amazonaws.com" and DNS change to "*.us-east-1.compute-1.amazonaws.com", then the exception is gone. 

       

      List<SubjectName> subjectAlts = new ArrayList<>();
      PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader.getDefault();
      
      // assume a certificate with multiple SANs, some of which might contain wildcards
      String host = "ec2.compute-1.amazonaws.com";
      subjectAlts.add(SubjectName.DNS("*.compute-1.amazonaws.com"));
      try {     
      DefaultHostnameVerifier.matchDNSName(host, subjectAlts, publicSuffixMatcher);
      }
      catch (Exception e) {
          System.out.println(e);
      } 
      
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            chen2 fan2
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: