# Elasticsearch TSL configuration issue

**URL:** <https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [December 16, 2021, 11:12pm UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230 "2021-12-16T23:12:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![userR](https://avatars.discourse-cdn.com/v4/letter/u/22d042/32.png) [@userR](https://discuss.elastic.co/u/userR)\
**Post date:** [December 16, 2021, 11:12pm UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230/1 "2021-12-16T23:12:10Z")

</div>

Following list of instructions here after configuring the basic security: [Set up basic security for the Elastic Stack | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup.html)

Instead of ./bin, I am doing /usr/share/Elasticsearch/bin ... as I installed on a CentOS machine. When I restart Elasticsearch, I receive the following error:

```auto
org.elasticsearch.bootstrap.StartupException: ElasticsearchSecurityException[failed to load SSL configuration [xpack.security.transport.ssl]]; nested: ElasticsearchException[failed to initialize SSL TrustManager - access to read truststore file [/usr/share/elasticsearch/elasticsearch/elastic-certificates.p12] is blocked; SSL resources should be placed in the [/etc/elasticsearch] directory]; nested: AccessControlException[access denied ("java.io.FilePermission" "/usr/share/elasticsearch/elasticsearch/elastic-certificates.p12" "read")];

```

So I went ahead and moved elastic-certificate.p12 and elastic-stack-ca.p12 to the /etc/Elasticsearch directory.

I then receive the following error:

```auto
failed to initialize SSL TrustManager - not permitted to read truststore file [/etc/elasticsearch/elastic-certificates.p12]

```

Is this issue because I loaded the elastic certificates incorrectly? How do I, by default, load them into /etc/Elasticsearch?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 20, 2021, 1:03am UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230/2 "2021-12-20T01:03:15Z")

</div>

The reason that the commands are `./bin` is because it expects you to be in `/etc/elasticsearch` and then creates the files in the paths with the right permissions it needs.

What are the permissions on the certificates?

---

<div class="post-metadata">

**Author:** ![userR](https://avatars.discourse-cdn.com/v4/letter/u/22d042/32.png) [@userR](https://discuss.elastic.co/u/userR)\
**Post date:** [December 20, 2021, 5:38pm UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230/3 "2021-12-20T17:38:41Z")

</div>

@warkolm here are the permissions (in usr/share/Elasticsearch):  
-rw------- 1 root root 3596 Dec 16 15:43 elastic-certificates.p12  
-rw------- 1 root root 2672 Dec 16 15:41 elastic-stack-ca.p12

How would I go about creating the files in the right path?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 20, 2021, 8:59pm UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230/4 "2021-12-20T20:59:41Z")

</div>

`sudo cp /usr/share/elasticsearch/*.p12 /etc/elasticsearch/.`  
`sudo chmod 644 /etc/elasticsearch/*.p12`

---

<div class="post-metadata">

**Author:** ![userR](https://avatars.discourse-cdn.com/v4/letter/u/22d042/32.png) [@userR](https://discuss.elastic.co/u/userR)\
**Post date:** [December 20, 2021, 9:12pm UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230/5 "2021-12-20T21:12:06Z")

</div>

Perfect, thanks @stephenb! Everything works now.

---

<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:** [January 17, 2022, 9:12pm UTC](https://discuss.elastic.co/t/elasticsearch-tsl-configuration-issue/292230/6 "2022-01-17T21:12:22Z")

</div>

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