Class DefaultHostnameVerifier
java.lang.Object
org.apache.hc.client5.http.ssl.DefaultHostnameVerifier
- All Implemented Interfaces:
HostnameVerifier, HttpClientHostnameVerifier
@Contract(threading=STATELESS)
public final class DefaultHostnameVerifier
extends Object
implements HttpClientHostnameVerifier
Default
HostnameVerifier implementation.- Since:
- 4.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate final PublicSuffixMatcher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static DefaultHostnameVerifier.HostNameTypedetermineHostFormat(String host) (package private) static String(package private) static List<SubjectName> (package private) static List<SubjectName> getSubjectAltNames(X509Certificate cert, int subjectName) (package private) static voidmatchCN(String host, X509Certificate cert, PublicSuffixMatcher publicSuffixMatcher) (package private) static voidmatchDNSName(String host, List<SubjectName> subjectAlts, PublicSuffixMatcher publicSuffixMatcher) (package private) static booleanmatchDomainRoot(String host, String domainRoot) (package private) static booleanmatchIdentity(String host, String identity) (package private) static booleanmatchIdentity(String host, String identity, PublicSuffixMatcher publicSuffixMatcher) (package private) static booleanmatchIdentity(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType) private static booleanmatchIdentity(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType, boolean strict) (package private) static booleanmatchIdentityStrict(String host, String identity) (package private) static booleanmatchIdentityStrict(String host, String identity, PublicSuffixMatcher publicSuffixMatcher) (package private) static booleanmatchIdentityStrict(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType) (package private) static voidmatchIPAddress(String host, List<SubjectName> subjectAlts) (package private) static voidmatchIPv6Address(String host, List<SubjectName> subjectAlts) (package private) static StringnormaliseAddress(String hostname) voidverify(String host, X509Certificate cert) Verifies the supplied serverX509Certificateand ensures it matches the original host name.booleanverify(String host, SSLSession session)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
publicSuffixMatcher
-
-
Constructor Details
-
DefaultHostnameVerifier
-
DefaultHostnameVerifier
public DefaultHostnameVerifier()
-
-
Method Details
-
verify
- Specified by:
verifyin interfaceHostnameVerifier
-
verify
Description 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:
SSLException
-
matchIPAddress
- Throws:
SSLException
-
matchIPv6Address
- Throws:
SSLException
-
matchDNSName
static void matchDNSName(String host, List<SubjectName> subjectAlts, PublicSuffixMatcher publicSuffixMatcher) throws SSLException - Throws:
SSLException
-
matchCN
static void matchCN(String host, X509Certificate cert, PublicSuffixMatcher publicSuffixMatcher) throws SSLException - Throws:
SSLException
-
matchDomainRoot
-
matchIdentity
private static boolean matchIdentity(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType, boolean strict) -
matchIdentity
-
matchIdentity
-
matchIdentityStrict
static boolean matchIdentityStrict(String host, String identity, PublicSuffixMatcher publicSuffixMatcher) -
matchIdentityStrict
-
matchIdentity
static boolean matchIdentity(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType) -
matchIdentityStrict
static boolean matchIdentityStrict(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType) -
extractCN
- Throws:
SSLException
-
determineHostFormat
-
getSubjectAltNames
-
getSubjectAltNames
-
normaliseAddress
-