# How to add certificates to java keystore

**URL:** <https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [March 13, 2020, 5:09pm UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546 "2020-03-13T17:09:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bikkina\_mahesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bikkina_mahesh/32/49176_2.png) [@bikkina\_mahesh](https://discuss.elastic.co/u/bikkina_mahesh)\
**Post date:** [March 13, 2020, 5:09pm UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546/1 "2020-03-13T17:09:40Z")

</div>

I need to connect to S3 repo from elasticsearch to store snapshots.  
Our S3 endpoint has mutual ssl authentication.  
I have ca.crt, client.key, client.crt.  
How to add these certs to java keystore, so that I can connect to s3 repository from elasticsearch.

---

<div class="post-metadata">

**Author:** ![Thibault\_Richard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thibault_richard/32/50513_2.png) [@Thibault\_Richard](https://discuss.elastic.co/u/Thibault_Richard)\
**Post date:** [April 9, 2020, 12:26pm UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546/2 "2020-04-09T12:26:48Z")

</div>

Here is a documentation that explains how to add secure settings to the Elasticsearch keystore: [https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-es-secure-settings.html](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-es-secure-settings.html).

There is another documentation to create automated snapshots that can help you (it uses Google Cloud Storage in favor of S3): [https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-snapshots.html](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-snapshots.html).

---

<div class="post-metadata">

**Author:** ![bikkina\_mahesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bikkina_mahesh/32/49176_2.png) [@bikkina\_mahesh](https://discuss.elastic.co/u/bikkina_mahesh)\
**Post date:** [April 9, 2020, 5:53pm UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546/3 "2020-04-09T17:53:22Z")

</div>

there are no secure settings to add certificates under repository-s3 documentation.  
[https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html](https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html).

In this cause how to add client certificates of s3 to my jvm? (elasticsearch running on xpack enabled).

---

<div class="post-metadata">

**Author:** ![bikkina\_mahesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bikkina_mahesh/32/49176_2.png) [@bikkina\_mahesh](https://discuss.elastic.co/u/bikkina_mahesh)\
**Post date:** [April 12, 2020, 9:59am UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546/4 "2020-04-12T09:59:16Z")

</div>

I added certificates in my jvm keystore. Here my question is why elastic search ( with xpack) is not picking those certificates while making connection with S3??  
Keystore property is overridden by elasticsearch to use its own keystore??

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [April 14, 2020, 8:30am UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546/5 "2020-04-14T08:30:54Z")

</div>

@bikkina_mahesh the [documentation page you linked](https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html) specifies that credentials should be added to the keystore.  
This is what we also call "secure settings".  
You can follow [ECK documentation on adding secure settings to the keystore](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-es-secure-settings.html) for those.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:49am UTC](https://discuss.elastic.co/t/how-to-add-certificates-to-java-keystore/223546/6 "2022-11-04T07:49:13Z")

</div>


