Class HBaseHostnameVerifier
java.lang.Object
org.apache.hadoop.hbase.io.crypto.tls.HBaseHostnameVerifier
- All Implemented Interfaces:
HostnameVerifier
When enabled in
X509Util
, handles verifying that the hostname of a peer matches the
certificate it presents.
This file has been copied from the Apache ZooKeeper project.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final class
Note: copied from Apache httpclient with some minor modifications. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static String
private static List<HBaseHostnameVerifier.SubjectName>
private static void
private static void
matchDNSName
(String host, List<HBaseHostnameVerifier.SubjectName> subjectAlts) private static boolean
matchIdentity
(String host, String identity, boolean strict) private static boolean
matchIdentityStrict
(String host, String identity) private static void
matchIPAddress
(String host, InetAddress inetAddress, List<HBaseHostnameVerifier.SubjectName> subjectAlts) private static Optional<InetAddress>
parseIpAddress
(String host) private static Optional<InetAddress>
parseIpAddressString
(String host) private static Optional<InetAddress>
(package private) void
verify
(String host, X509Certificate cert) boolean
verify
(String host, SSLSession session)
-
Field Details
-
LOG
-
-
Constructor Details
-
HBaseHostnameVerifier
-
-
Method Details
-
verify
- Specified by:
verify
in interfaceHostnameVerifier
-
verify
- Throws:
SSLException
-
matchIPAddress
private static void matchIPAddress(String host, InetAddress inetAddress, List<HBaseHostnameVerifier.SubjectName> subjectAlts) throws SSLException - Throws:
SSLException
-
matchDNSName
private static void matchDNSName(String host, List<HBaseHostnameVerifier.SubjectName> subjectAlts) throws SSLException - Throws:
SSLException
-
matchCN
- Throws:
SSLException
-
matchIdentity
-
matchIdentityStrict
-
extractCN
- Throws:
SSLException
-
parseIpAddress
-
parseIpAddressUriString
-
parseIpAddressString
-
getSubjectAltNames
-