Package javax.net.ssl
Class DefaultHostnameVerifier
java.lang.Object
javax.net.ssl.DefaultHostnameVerifier
- All Implemented Interfaces:
HostnameVerifier
public final class DefaultHostnameVerifier extends Object implements HostnameVerifier
A HostnameVerifier consistent with RFC 2818.
-
Constructor Summary
Constructors Constructor Description DefaultHostnameVerifier() -
Method Summary
Modifier and Type Method Description booleanverify(String host, X509Certificate certificate)booleanverify(String host, SSLSession session)Verifies that the specified hostname is allowed within the specified SSL session.booleanverifyHostName(String hostName, String cn)Returns true ifhostNamematches the name or patterncn.
-
Constructor Details
-
DefaultHostnameVerifier
public DefaultHostnameVerifier()
-
-
Method Details
-
verify
Description copied from interface:HostnameVerifierVerifies that the specified hostname is allowed within the specified SSL session.- Specified by:
verifyin interfaceHostnameVerifier- Parameters:
host- the hostname.session- the SSL session of the connection.- Returns:
trueif the specified hostname is allowed, otherwisefalse.
-
verify
-
verifyHostName
Returns true ifhostNamematches the name or patterncn.- Parameters:
hostName- lowercase host name.cn- certificate host name. May include wildcards like*.android.com.
-