Reputation: 43
Has anyone come up with a way to secure communication between Cassandra and Astyanax client? SSL is preferred to be able to do client cert auth + encryption...
Upvotes: 4
Views: 469
Reputation: 14173
I'm going to assume you've enabled SSL in cassandra and have the keystore file, if not full blog on enabling SSL in Astyanax here.
You need to pass the keystore file and it's password to Astyanax when you are building the Keyspace context:
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();
Upvotes: 1