net.i2p.apache.http.conn.ssl

## Class DefaultHostnameVerifier

- java.lang.Object
- - net.i2p.apache.http.conn.ssl.DefaultHostnameVerifier

- All Implemented Interfaces:
    HostnameVerifier

      public final class DefaultHostnameVerifier
      extends Object
      implements HostnameVerifier

  Default `HostnameVerifier` implementation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static int` | `DNS_NAME_TYPE` DNS name type constant
    `(package private) static int` | `IP_ADDRESS_TYPE` IP address type constant

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultHostnameVerifier()` Create hostname verifier with default settings.
    `DefaultHostnameVerifier(PublicSuffixMatcher publicSuffixMatcher)` Create hostname verifier with public suffix matcher.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) static String` | `extractCN(String subjectPrincipal)`
    `(package private) static List<String>` | `extractSubjectAlts(X509Certificate cert, int subjectType)`
    `(package private) static void` | `matchCN(String host, String cn, PublicSuffixMatcher publicSuffixMatcher)`
    `(package private) static void` | `matchDNSName(String host, List<String> subjectAlts, PublicSuffixMatcher publicSuffixMatcher)`
    `(package private) static boolean` | `matchDomainRoot(String host, String domainRoot)`
    `(package private) static boolean` | `matchIdentity(String host, String identity)`
    `(package private) static boolean` | `matchIdentity(String host, String identity, PublicSuffixMatcher publicSuffixMatcher)`
    `(package private) static boolean` | `matchIdentityStrict(String host, String identity)`
    `(package private) static boolean` | `matchIdentityStrict(String host, String identity, PublicSuffixMatcher publicSuffixMatcher)`
    `(package private) static void` | `matchIPAddress(String host, List<String> subjectAlts)`
    `(package private) static void` | `matchIPv6Address(String host, List<String> subjectAlts)`
    `(package private) static String` | `normaliseAddress(String hostname)`
    `boolean` | `verify(String host, SSLSession session)`
    `void` | `verify(String host, X509Certificate cert)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DNS_NAME_TYPE

          static final int DNS_NAME_TYPE

      DNS name type constant
      See Also:
        Constant Field Values

    - #### IP_ADDRESS_TYPE

          static final int IP_ADDRESS_TYPE

      IP address type constant
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultHostnameVerifier

          public DefaultHostnameVerifier()

      Create hostname verifier with default settings.

    - #### DefaultHostnameVerifier

          public DefaultHostnameVerifier(PublicSuffixMatcher publicSuffixMatcher)

      Create hostname verifier with public suffix matcher.
      Parameters:
        `publicSuffixMatcher` - public suffix matcher

  - ### Method Detail

    - #### extractCN

          static String extractCN(String subjectPrincipal)
                           throws SSLException

      Throws:
        `SSLException`

    - #### extractSubjectAlts

          static List<String> extractSubjectAlts(X509Certificate cert,
                                                 int subjectType)

    - #### matchCN

          static void matchCN(String host,
                              String cn,
                              PublicSuffixMatcher publicSuffixMatcher)
                       throws SSLException

      Throws:
        `SSLException`

    - #### matchDNSName

          static void matchDNSName(String host,
                                   List<String> subjectAlts,
                                   PublicSuffixMatcher publicSuffixMatcher)
                            throws SSLException

      Throws:
        `SSLException`

    - #### matchDomainRoot

          static boolean matchDomainRoot(String host,
                                         String domainRoot)

    - #### matchIdentity

          static boolean matchIdentity(String host,
                                       String identity)

    - #### matchIdentity

          static boolean matchIdentity(String host,
                                       String identity,
                                       PublicSuffixMatcher publicSuffixMatcher)

    - #### matchIdentityStrict

          static boolean matchIdentityStrict(String host,
                                             String identity)

    - #### matchIdentityStrict

          static boolean matchIdentityStrict(String host,
                                             String identity,
                                             PublicSuffixMatcher publicSuffixMatcher)

    - #### matchIPAddress

          static void matchIPAddress(String host,
                                     List<String> subjectAlts)
                              throws SSLException

      Throws:
        `SSLException`

    - #### matchIPv6Address

          static void matchIPv6Address(String host,
                                       List<String> subjectAlts)
                                throws SSLException

      Throws:
        `SSLException`

    - #### normaliseAddress

          static String normaliseAddress(String hostname)

    - #### verify

          public final boolean verify(String host,
                                      SSLSession session)

      Specified by:
        `verify` in interface `HostnameVerifier`

    - #### verify

          public final void verify(String host,
                                   X509Certificate cert)
                            throws SSLException

      Throws:
        `SSLException`