Class TLSStore
java.lang.Object
org.apache.hadoop.hbase.io.crypto.tls.TLSStore
One keystore or truststore, resolved from configuration with every attribute drawn from a single
key prefix.
Each TLS surface exposes two prefixes for the same store: a role-scoped one added for single-EKU
certificate support (e.g.
hbase.rpc.tls.server.) and the historical unscoped one (e.g.
hbase.rpc.tls.). Resolving attribute by attribute would let a store's location come from
one prefix while its password or type came from the other, which opens either the wrong file or
the right file with the wrong credentials. resolve(org.apache.hadoop.conf.Configuration, java.lang.String, java.lang.String, org.apache.hadoop.hbase.io.crypto.tls.TLSStore.Keys) therefore picks the prefix once, from
the location, and reads the rest of the store from that same prefix.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe key postfixes making up one store, by surface. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFalls back to the store password when no separate key password is configured.char[]char[]For the netty paths, whose key/trust manager factories take char[].getType()private static voidlogOnce(org.apache.hadoop.conf.Configuration config, String rolePrefix, String legacyPrefix, TLSStore.Keys keys) static TLSStoreresolve(org.apache.hadoop.conf.Configuration config, String rolePrefix, String legacyPrefix, TLSStore.Keys keys) Reads one store fromconfig.
-
Field Details
-
LOG
-
LOGGED_STORES
Stores already checked for unused legacy keys, so the scan and the warning happen once. -
location
-
password
-
keyPassword
-
type
-
-
Constructor Details
-
TLSStore
-
-
Method Details
-
resolve
public static TLSStore resolve(org.apache.hadoop.conf.Configuration config, String rolePrefix, String legacyPrefix, TLSStore.Keys keys) throws IOException Reads one store fromconfig. The prefix supplying the location supplies every other attribute too, so the two prefixes are never combined within a single store. Only the location is mandatory under a prefix: a store may have no password at all, and the type is auto-detected from the file extension when absent (seeKeyStoreFileType.fromPropertyValueOrFileName(java.lang.String, java.lang.String)). Keeping the legacy keys in place while migrating is valid -- the ones left unused are logged once so they can be cleaned up.- Parameters:
config- the configuration to read fromrolePrefix- role-scoped prefix, e.g.hbase.rpc.tls.server.legacyPrefix- historical unscoped prefix, e.g.hbase.rpc.tls.keys- which store to read, and under which postfixes- Throws:
IllegalArgumentException- ifrolePrefixsupplies any attribute but not the location, since the location would then be taken fromlegacyPrefixIOException
-
logOnce
private static void logOnce(org.apache.hadoop.conf.Configuration config, String rolePrefix, String legacyPrefix, TLSStore.Keys keys) -
getLocation
-
getPassword
-
getKeyPassword
Falls back to the store password when no separate key password is configured. -
getPasswordChars
For the netty paths, whose key/trust manager factories take char[]. -
getKeyPasswordChars
- See Also:
-
getType
-