Class DefaultHostnameVerifier

  • All Implemented Interfaces:
    javax.net.ssl.HostnameVerifier, HttpClientHostnameVerifier

    @Contract(threading=STATELESS)
    public final class DefaultHostnameVerifier
    extends java.lang.Object
    implements HttpClientHostnameVerifier
    Default HostnameVerifier implementation.
    Since:
    4.4
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void verify​(java.lang.String host, java.security.cert.X509Certificate cert)
      Verifies the supplied server X509Certificate and ensures it matches the original host name.
      boolean verify​(java.lang.String host, javax.net.ssl.SSLSession session)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultHostnameVerifier

        public DefaultHostnameVerifier​(PublicSuffixMatcher publicSuffixMatcher)
        Constructs new instance with a PublicSuffixMatcher.
        Parameters:
        publicSuffixMatcher - a PublicSuffixMatcher.
      • DefaultHostnameVerifier

        public DefaultHostnameVerifier()
        Constructs new instance without a PublicSuffixMatcher.
    • Method Detail

      • verify

        public boolean verify​(java.lang.String host,
                              javax.net.ssl.SSLSession session)
        Specified by:
        verify in interface javax.net.ssl.HostnameVerifier
      • verify

        public void verify​(java.lang.String host,
                           java.security.cert.X509Certificate cert)
                    throws javax.net.ssl.SSLException
        Description copied from interface: HttpClientHostnameVerifier
        Verifies the supplied server X509Certificate and ensures it matches the original host name.
        Specified by:
        verify in interface HttpClientHostnameVerifier
        Parameters:
        host - the original host name.
        cert - the server certificate;
        Throws:
        javax.net.ssl.SSLException