Package org.apache.hc.client5.http.ssl
Class DefaultHostnameVerifier
- java.lang.Object
-
- org.apache.hc.client5.http.ssl.DefaultHostnameVerifier
-
- All Implemented Interfaces:
javax.net.ssl.HostnameVerifier,HttpClientHostnameVerifier
@Contract(threading=STATELESS) public final class DefaultHostnameVerifier extends java.lang.Object implements HttpClientHostnameVerifier
DefaultHostnameVerifierimplementation.- Since:
- 4.4
-
-
Constructor Summary
Constructors Constructor Description DefaultHostnameVerifier()Constructs new instance without a PublicSuffixMatcher.DefaultHostnameVerifier(PublicSuffixMatcher publicSuffixMatcher)Constructs new instance with a PublicSuffixMatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidverify(java.lang.String host, java.security.cert.X509Certificate cert)Verifies the supplied serverX509Certificateand ensures it matches the original host name.booleanverify(java.lang.String host, javax.net.ssl.SSLSession session)
-
-
-
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:
verifyin interfacejavax.net.ssl.HostnameVerifier
-
verify
public void verify(java.lang.String host, java.security.cert.X509Certificate cert) throws javax.net.ssl.SSLExceptionDescription copied from interface:HttpClientHostnameVerifierVerifies the supplied serverX509Certificateand ensures it matches the original host name.- Specified by:
verifyin interfaceHttpClientHostnameVerifier- Parameters:
host- the original host name.cert- the server certificate;- Throws:
javax.net.ssl.SSLException
-
-