Astyanax和Cassandra之间的安全通信

4

有没有人想到一种方法来保护Cassandra和Astyanax客户端之间的通信安全?SSL是首选,以便进行客户端证书认证和加密...

1个回答

1
我假设您已经在cassandra中启用了SSL,并拥有密钥库文件。如果没有,请参阅在Astyanax中启用SSL的完整博客
当您构建Keyspace上下文时,需要将密钥库文件及其密码传递给Astyanax。
AstyanaxContext<Keyspace> ctx = new AstyanaxContext.Builder()
    .forKeyspace("MyKeyspace")
    // Config parameters
    .withConnectionPoolConfiguration(
         new com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl("MyConnectionPool")
        .setSeeds("127.0.0.1")
        .setSSLConnectionContext(
             new SSLConnectionContext(
             "/path/to/certificate/cassandra_external_trust.jks", // tell Astyanax the fully qualified path to the keystore file C* is using
             "somePassword")))                                    // supply the keystore file's password too
    .buildKeyspace(ThriftFamilyFactory.getInstance());
ctx.start();

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接