Package org.apache.hadoop.hbase.rest
Class TestRESTServerSSL
java.lang.Object
org.apache.hadoop.hbase.rest.TestRESTServerSSL
@Tag("org.apache.hadoop.hbase.testclassification.RestTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests")
public class TestRESTServerSSL
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configurationprivate static final Stringprivate static Fileprivate static final org.slf4j.Loggerprivate static final HBaseRESTTestingUtilityprivate static org.apache.hadoop.hbase.rest.client.Clientprivate static final HBaseTestingUtilprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidvoidprivate static voidgenerateKeyStore(String keyStoreType, KeyPair keyPair, X509Certificate serverCertificate) private static voidgenerateTrustStore(String trustStoreType, X509Certificate serverCertificate) private static StringgetKeystoreFilePath(String keyStoreType) private static StringgetTruststoreFilePath(String trustStoreType) private static voidprivate static Fileprivate voidstartRESTServer(String storeType) private voidvoidvoidWithclient.auth.mode=NEED, an anonymous client (no client cert) is rejected by the server.voidWithclient.auth.mode=NONE(the default), a client that presents no client certificate is accepted — matching today's behavior.voidWithclient.auth.mode=WANT, an anonymous client (no client cert) is still accepted; the server requests a cert but does not require it.voidvoidvoidBackward-compatibility regression: existing deployments that know only about the legacy unscoped keys must continue to work exactly as before.voidvoidvoidvoidServer started with only the role-scoped hbase.rest.ssl.server.* keys (and legacy keys unset).
-
Field Details
-
LOG
-
KEY_STORE_PASSWORD
- See Also:
-
TRUST_STORE_PASSWORD
- See Also:
-
TEST_UTIL
-
REST_TEST_UTIL
-
sslClient
-
keyDir
-
conf
-
-
Constructor Details
-
TestRESTServerSSL
public TestRESTServerSSL()
-
-
Method Details
-
initializeAlgorithmId
-
beforeClass
- Throws:
Exception
-
afterClass
- Throws:
Exception
-
beforeEachTest
-
tearDownAfterTest
-
testSslConnection
- Throws:
Exception
-
testNonSslClientDenied
- Throws:
Exception
-
testSslConnectionUsingKeystoreFormatJKS
- Throws:
Exception
-
testSslConnectionUsingKeystoreFormatJCEKS
- Throws:
Exception
-
testSslConnectionUsingKeystoreFormatPKCS12
- Throws:
Exception
-
testSslConnectionUsingRoleScopedServerKeys
Server started with only the role-scoped hbase.rest.ssl.server.* keys (and legacy keys unset). A successful SSL connection proves the server-scoped keys were consulted.- Throws:
Exception
-
testSslConnectionFallsBackToLegacyKeystoreKeys
Backward-compatibility regression: existing deployments that know only about the legacy unscoped keys must continue to work exactly as before. This mirrorstestSslConnection()but names the intent explicitly.- Throws:
Exception
-
testClientAuthNoneAcceptsClientWithoutCert
Withclient.auth.mode=NONE(the default), a client that presents no client certificate is accepted — matching today's behavior.- Throws:
Exception
-
testClientAuthWantAllowsAnonymousClient
Withclient.auth.mode=WANT, an anonymous client (no client cert) is still accepted; the server requests a cert but does not require it.- Throws:
Exception
-
testClientAuthNeedRejectsClientWithoutCert
Withclient.auth.mode=NEED, an anonymous client (no client cert) is rejected by the server. The baseClientconfigures truststore-only, so it presents no key material to the server.- Throws:
Exception
-
initKeystoreDir
-
generateKeyStore
private static void generateKeyStore(String keyStoreType, KeyPair keyPair, X509Certificate serverCertificate) throws Exception - Throws:
Exception
-
generateTrustStore
private static void generateTrustStore(String trustStoreType, X509Certificate serverCertificate) throws Exception - Throws:
Exception
-
getKeystoreFilePath
-
getTruststoreFilePath
-
startRESTServerWithDefaultKeystoreType
- Throws:
Exception
-
startRESTServer
- Throws:
Exception
-