# SSL error when using S3 compatible repository with letsencrypt certificate

**URL:** <https://discuss.elastic.co/t/ssl-error-when-using-s3-compatible-repository-with-letsencrypt-certificate/313791>\
**Category:** Elasticsearch\
**Tags:** docker, snapshot-and-restore\
**Created:** [September 6, 2022, 12:17pm UTC](https://discuss.elastic.co/t/ssl-error-when-using-s3-compatible-repository-with-letsencrypt-certificate/313791 "2022-09-06T12:17:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![albanm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/albanm/32/110527_2.png) [@albanm](https://discuss.elastic.co/u/albanm)\
**Post date:** [September 6, 2022, 12:17pm UTC](https://discuss.elastic.co/t/ssl-error-when-using-s3-compatible-repository-with-letsencrypt-certificate/313791/1 "2022-09-06T12:17:25Z")

</div>

Hello,

I have installed a minio server protected by a certificate issued by letsencrypt to serve as a snapshot repository for my elasticsearch cluster (version 7.17.6). When I try to create the registry (curl -X PUT "localhost:9200/\_snapshot/minio-repository" with my endpoint) I get a "unable to find valid certification path to requested target" error.

The closest discussion I could find is [S3 Repo plugin failing certificate validation with MiniO, already added cert to Jdk truststore](https://discuss.elastic.co/t/s3-repo-plugin-failing-certificate-validation-with-minio-already-added-cert-to-jdk-truststore/269069) but it is not exactly the same thing and there is no complete answer.

I tried to use this recipe [Import Let's Encrypt certificates into Java's trusted keystore (cacerts) · GitHub](https://gist.github.com/richmilne/5a5cb4be0ec8233a6c50ba40229d8278) and simply changed the keystore path to /usr/share/elasticsearch/jdk/lib/security/cacerts and the keytool exe to /usr/share/elasticsearch/jdk/bin/keytool. But it doesn't change a thing.

Is /usr/share/elasticsearch/jdk/lib/security/cacerts the right keystore to add let's encrypt authority certificates ?

---

<div class="post-metadata">

**Author:** ![albanm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/albanm/32/110527_2.png) [@albanm](https://discuss.elastic.co/u/albanm)\
**Post date:** [September 13, 2022, 7:07am UTC](https://discuss.elastic.co/t/ssl-error-when-using-s3-compatible-repository-with-letsencrypt-certificate/313791/2 "2022-09-13T07:07:57Z")

</div>

I forgot to specify that I work in a docker context. The image definition with the script that attempts to import lets'encrypt authority certificates is available here [elasticsearch/Dockerfile at 7.x · data-fair/elasticsearch · GitHub](https://github.com/data-fair/elasticsearch/blob/7.x/Dockerfile)

---

<div class="post-metadata">

**Author:** ![albanm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/albanm/32/110527_2.png) [@albanm](https://discuss.elastic.co/u/albanm)\
**Post date:** [September 13, 2022, 2:49pm UTC](https://discuss.elastic.co/t/ssl-error-when-using-s3-compatible-repository-with-letsencrypt-certificate/313791/3 "2022-09-13T14:49:06Z")

</div>

This is solved. The problem was that I was missing path\_style\_access=true option. I think the request was emitted to a subdomain instead of a path on the intended domain, which was not compatible with the way my minio server was exposed.

---

<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:** [October 11, 2022, 2:49pm UTC](https://discuss.elastic.co/t/ssl-error-when-using-s3-compatible-repository-with-letsencrypt-certificate/313791/4 "2022-10-11T14:49:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
