3.4. Hot Rod クライアントの暗号化の設定
Data Grid Server は、SSL/TLS 暗号化を実施し、Hot Rod クライアントに証明書を提示して、信頼を確立し、安全な接続をネゴシエートできます。
Data Grid Server に発行された証明書を検証するには、Hot Rod クライアントでは、完全な証明書チェーンまたは Root CA で始まる部分的なチェーンのいずれかが必要です。サーバー証明書をトラストストアとして Hot Rod クライアントに提供します。
トラストストアを提供する代わりに、共有システム証明書を使用できます。
前提条件
- Hot Rod クライアントが Data Grid Server アイデンティティーを検証するのに使用できるトラストストアを作成します。
- Data Grid Server を設定してクライアント証明書を検証または認証する場合は、必要に応じてキーストアを作成します。
手順
-
trustStoreFileName()メソッドおよびtrustStorePassword()メソッドまたは対応するプロパティーを使用して、トラストストアをクライアント設定に追加します。 クライアント証明書認証を設定する場合は、次のようにします。
-
keyStoreFileName()メソッドおよびkeyStorePassword()メソッドまたは対応するプロパティーを使用して、クライアント設定にキーストアを追加します。 -
EXTERNAL認証メカニズムを使用するようにクライアントを設定します。
-
ConfigurationBuilder
ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
clientBuilder
.addServer()
.host("127.0.0.1")
.port(11222)
.security()
.ssl()
// Server SNI hostname.
.sniHostName("myservername")
// Keystore that contains the public keys for Data Grid Server.
// Clients use the trust store to verify Data Grid Server identities.
.trustStoreFileName("/path/to/server/truststore")
.trustStorePassword("truststorepassword".toCharArray())
.trustStoreType("PCKS12")
// Keystore that contains client certificates.
// Clients present these certificates to Data Grid Server.
.keyStoreFileName("/path/to/client/keystore")
.keyStorePassword("keystorepassword".toCharArray())
.keyStoreType("PCKS12")
.authentication()
// Clients must use the EXTERNAL mechanism for certificate authentication.
.saslMechanism("EXTERNAL");
hotrod-client.properties
infinispan.client.hotrod.server_list = 127.0.0.1:11222
infinispan.client.hotrod.use_ssl = true
infinispan.client.hotrod.sni_host_name = myservername
# Keystore that contains the public keys for Data Grid Server.
# Clients use the trust store to verify Data Grid Server identities.
infinispan.client.hotrod.trust_store_file_name = server_truststore.pkcs12
infinispan.client.hotrod.trust_store_password = changeme
infinispan.client.hotrod.trust_store_type = PCKS12
# Keystore that contains client certificates.
# Clients present these certificates to Data Grid Server.
infinispan.client.hotrod.key_store_file_name = client_keystore.pkcs12
infinispan.client.hotrod.key_store_password = changeme
infinispan.client.hotrod.key_store_type = PCKS12
# Clients must use the EXTERNAL mechanism for certificate authentication.
infinispan.client.hotrod.sasl_mechanism = EXTERNAL
次のステップ
クライアントトラストストアを $RHDG_HOME/server/conf ディレクトリーに追加し、必要に応じてそれを使用するように Data Grid Server を設定します。