Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.http.conn.ssl
Interface X509HostnameVerifier

All Superinterfaces:
  HostnameVerifier

All Known Implementing Classes:
  AbstractVerifier, AllowAllHostnameVerifier, BrowserCompatHostnameVerifier, StrictHostnameVerifier

    public interface X509HostnameVerifier

extends HostnameVerifier

Interface for checking if a hostname matches the names stored inside the server's X.509 certificate. This interface extends `HostnameVerifier`, but it is recommended to use methods added by X509HostnameVerifier.

Since:
  4.0

Method Summary
`void` | `verify(String host, SSLSocket ssl)` Verifies that the host name is an acceptable match with the server's authentication scheme based on the given `SSLSocket`.
`void` | `verify(String host, String[] cns, String[] subjectAlts)` Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts.
`void` | `verify(String host, X509Certificate cert)` Verifies that the host name is an acceptable match with the server's authentication scheme based on the given `X509Certificate`.

Methods inherited from interface javax.net.ssl.HostnameVerifier
`verify`

Method Detail

### verify

    void verify(String host,
                SSLSocket ssl)
                throws IOException

  Verifies that the host name is an acceptable match with the server's authentication scheme based on the given `SSLSocket`.

  Parameters:
    `host` - the host.
    `ssl` - the SSL socket.
  Throws:
    `IOException` - if an I/O error occurs or the verification process fails.

### verify

    void verify(String host,
                X509Certificate cert)
                throws SSLException

  Verifies that the host name is an acceptable match with the server's authentication scheme based on the given `X509Certificate`.

  Parameters:
    `host` - the host.
    `cert` - the certificate.
  Throws:
    `SSLException` - if the verification process fails.

### verify

    void verify(String host,
                String[] cns,
                String[] subjectAlts)
                throws SSLException

  Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts. Most implementations only look at the first CN, and ignore any additional CNs. Most implementations do look at all of the "DNS" Subject-Alts. The CNs or Subject-Alts may contain wildcards according to RFC 2818.

  Parameters:
    `cns` - CN fields, in order, as extracted from the X.509 certificate.
    `subjectAlts` - Subject-Alt fields of type 2 ("DNS"), as extracted from the X.509 certificate.
    `host` - The hostname to verify.
  Throws:
    `SSLException` - if the verification process fails.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.