Top Description Methods
org.apache.http.conn.ssl

public Interface X509HostnameVerifier

extends HostnameVerifier
Known Direct Implementers
org.apache.http.conn.ssl.AbstractVerifier
Annotations
@Deprecated
Imports
java.io.IOException, java.security.cert.X509Certificate, javax.net.ssl.HostnameVerifier, .SSLException, .SSLSocket

Deprecated

(4.4) Use javax.net.ssl.HostnameVerifier.

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

Method Summary

Modifier and TypeMethod and Description
public void
verify(String
the host.
host
,
SSLSocket
the SSL socket.
ssl
)

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

public void
verify(String
the host.
host
,
X509Certificate
the certificate.
cert
)

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

public void
verify(String
The hostname to verify.
host
,
String[]
CN fields, in order, as extracted from the X.509 certificate.
cns
,
String[]
Subject-Alt fields of type 2 ("DNS"), as extracted from the X.509 certificate.
subjectAlts
)

Checks to see if the supplied hostname matches any of the supplied CNs or "DNS" Subject-Alts.

Inherited from javax.net.ssl.HostnameVerifier:
verify

Method Detail

verifyback to summary
public 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:String

the host.

ssl:SSLSocket

the SSL socket.

Exceptions
IOException:
if an I/O error occurs or the verification process fails.
verifyback to summary
public 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:String

the host.

cert:X509Certificate

the certificate.

Exceptions
SSLException:
if the verification process fails.
verifyback to summary
public 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
host:String

The hostname to verify.

cns:String[]

CN fields, in order, as extracted from the X.509 certificate.

subjectAlts:String[]

Subject-Alt fields of type 2 ("DNS"), as extracted from the X.509 certificate.

Exceptions
SSLException:
if the verification process fails.