Package org.apache.hc.client5.http.ssl
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.Logger
private final PublicSuffixMatcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static DefaultHostnameVerifier.HostNameType
determineHostFormat
(String host) (package private) static String
(package private) static List
<SubjectName> (package private) static List
<SubjectName> getSubjectAltNames
(X509Certificate cert, int subjectName) (package private) static void
matchCN
(String host, X509Certificate cert, PublicSuffixMatcher publicSuffixMatcher) (package private) static void
matchDNSName
(String host, List<SubjectName> subjectAlts, PublicSuffixMatcher publicSuffixMatcher) (package private) static boolean
matchDomainRoot
(String host, String domainRoot) (package private) static boolean
matchIdentity
(String host, String identity) (package private) static boolean
matchIdentity
(String host, String identity, PublicSuffixMatcher publicSuffixMatcher) (package private) static boolean
matchIdentity
(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType) private static boolean
matchIdentity
(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType, boolean strict) (package private) static boolean
matchIdentityStrict
(String host, String identity) (package private) static boolean
matchIdentityStrict
(String host, String identity, PublicSuffixMatcher publicSuffixMatcher) (package private) static boolean
matchIdentityStrict
(String host, String identity, PublicSuffixMatcher publicSuffixMatcher, DomainType domainType) (package private) static void
matchIPAddress
(String host, List<SubjectName> subjectAlts) (package private) static void
matchIPv6Address
(String host, List<SubjectName> subjectAlts) (package private) static String
normaliseAddress
(String hostname) void
verify
(String host, X509Certificate cert) Verifies the supplied serverX509Certificate
and ensures it matches the original host name.boolean
verify
(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:
verify
in interfaceHostnameVerifier
-
verify
Description copied from interface:HttpClientHostnameVerifier
Verifies the supplied serverX509Certificate
and ensures it matches the original host name.- Specified by:
verify
in 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
-