# CA certificate Cassandra connection

**URL:** <https://discuss.akka.io/t/ca-certificate-cassandra-connection/6924>\
**Category:** Persistence / Event Sourcing\
**Tags:** configuration\
**Created:** [July 23, 2020, 7:51am UTC](https://discuss.akka.io/t/ca-certificate-cassandra-connection/6924 "2020-07-23T07:51:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SynappsGiteau](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/synappsgiteau/32/2214_2.png) [@SynappsGiteau](https://discuss.akka.io/u/SynappsGiteau)\
**Post date:** [July 23, 2020, 7:51am UTC](https://discuss.akka.io/t/ca-certificate-cassandra-connection/6924/1 "2020-07-23T07:51:59Z")

</div>

Hi,  
We are trying to configure our Cassandra connection (for akka-persistence-cassandra) to a Cassandra cluster (hosted by Aiven) providing only a CA Certificate (ca.pem).

In the reference.conf file, I don’t see any configuration in which we can associate the ca.pem file provided by the host (Aiven).

Could someone please tell us how to proceed?

Thank you.

---

<div class="post-metadata">

**Author:** ![ignasi35](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/ignasi35/32/62_2.png) [@ignasi35](https://discuss.akka.io/u/ignasi35)\
**Post date:** [July 23, 2020, 8:02am UTC](https://discuss.akka.io/t/ca-certificate-cassandra-connection/6924/2 "2020-07-23T08:02:57Z")

</div>

Hi @SynappsGiteau,

Did you try setting [`truststore.path`](https://github.com/akka/akka-persistence-cassandra/blob/v0.103/core/src/main/resources/reference.conf#L259-L270)?

Keep in mind that lagom creates 3 different connections to Cassandra for `journal`, `snapshots` and `read-side` so you will need to set that up under three different namespaces on the settings.

Cheers,

---

<div class="post-metadata">

**Author:** ![SynappsGiteau](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/synappsgiteau/32/2214_2.png) [@SynappsGiteau](https://discuss.akka.io/u/SynappsGiteau)\
**Post date:** [July 23, 2020, 8:17am UTC](https://discuss.akka.io/t/ca-certificate-cassandra-connection/6924/3 "2020-07-23T08:17:43Z")

</div>

I tried that but I got this error : java.io.IOException: Invalid keystore format

From what I know, I can’t create a trustore using only the ca.pem certificate (without the key).

---

<div class="post-metadata">

**Author:** ![SynappsGiteau](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/synappsgiteau/32/2214_2.png) [@SynappsGiteau](https://discuss.akka.io/u/SynappsGiteau)\
**Post date:** [July 23, 2020, 8:34am UTC](https://discuss.akka.io/t/ca-certificate-cassandra-connection/6924/4 "2020-07-23T08:34:05Z")

</div>

I found the solution (obvious…). I just created a trustore with the following command:

keytool -import -alias test -file test.cert.pem -keystore truststore

Thanks for your help :)
