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

DefaultHostnameVerifier should use CN matching when no dNSName present

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 5.0.4, 5.1
    • HttpClient (classic)
    • None

    Description

      RFC 2818 3.1 says: "If a subjectAltName extension of type dNSName is present, that MUST be used as the identity. Otherwise, the (most specific) Common Name field in the Subject field of the certificate MUST be used."

      Consider a certificate having a (non-empty) subjectAltName extension containing only entries of type SubjectName.IP, and suppose that DefaultHostnameVerifier.verify(String, X509Certificate) is called with a host of type HostNameType.DNS. Then matchDNSName will be called to try and match host against subjectAlts and will fail since there are no dNSName entries to match against.

      However per the RFC 2818 requirement above, having found no dNSName entries, the check should fall back to matching against the CN.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              peter.dettman Peter Dettman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m