Farafonov
Farafonov

Reputation: 43

Secure communication between Astyanax and Cassandra

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

Answers (1)

Lyuben Todorov
Lyuben Todorov

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

Related Questions