public class DefaultHostnameVerifier extends Object implements HostnameVerifier, CertificateHostnameVerifier
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultHostnameVerifier.SSLSocketFactory
Socket factory that uses
DefaultHostnameVerifier. |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger
Log for this class.
|
| Constructor and Description |
|---|
DefaultHostnameVerifier() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
verify(String hostname,
SSLSession session) |
boolean |
verify(String hostname,
X509Certificate cert)
Verify if the hostname is an IP address using
LdapUtil.isIPAddress(String). |
protected boolean |
verifyDNS(String hostname,
X509Certificate cert)
Verify the certificate allows use of the supplied DNS name.
|
protected boolean |
verifyIP(String ip,
X509Certificate cert)
Verify the certificate allows use of the supplied IP address.
|
public boolean verify(String hostname, SSLSession session)
verify in interface HostnameVerifierpublic boolean verify(String hostname, X509Certificate cert)
LdapUtil.isIPAddress(String). Delegates to
verifyIP(String, X509Certificate) and
verifyDNS(String, X509Certificate) accordingly.verify in interface CertificateHostnameVerifierhostname - to verifycert - to verify hostname againstprotected boolean verifyIP(String ip, X509Certificate cert)
ip - address to match in the certificatecert - to inspect for the IP addressprotected boolean verifyDNS(String hostname, X509Certificate cert)
hostname - to match in the certificatecert - to inspect for the hostnameCopyright © 2014. All rights reserved.