# Is there a way to specify multiple cacert files

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-specify-multiple-cacert-files/245694>\
**Category:** Logstash\
**Created:** [August 20, 2020, 2:30am UTC](https://discuss.elastic.co/t/is-there-a-way-to-specify-multiple-cacert-files/245694 "2020-08-20T02:30:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qingkun\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qingkun_li/32/55820_2.png) [@Qingkun\_Li](https://discuss.elastic.co/u/Qingkun_Li)\
**Post date:** [August 20, 2020, 2:30am UTC](https://discuss.elastic.co/t/is-there-a-way-to-specify-multiple-cacert-files/245694/1 "2020-08-20T02:30:52Z")

</div>

Can we specify multiple cacert files? I have multiple Elasticsearch clusters configured with the same domain name (e.g. **[es.xxx.com](http://es.xxx.com)**), and use DNS to decide which Elasticsearch cluster to use. So my logstash output setting is like:

```auto
elasticsearch {
    hosts => ["https://es.xxx.com"]
    cacert => '/path/to/cacert'
    user => "xxx"
    password => "xxx"
    index => "xxx"
}

```

Since **[es.xxx.com](http://es.xxx.com)** may be resolved to differentiations Elasticsearch clusters, and each cluster uses its own cacert, I'd like a way to specify multiple cacert files.

I've tried to put all cacert in the same file (like the following), but only the last one is used.

```auto
-----BEGIN CERTIFICATE-----
xxxxxxxxxx
xxxxxxxxxx
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
xxxxxxxxxx
xxxxxxxxxx
-----END CERTIFICATE-----

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 20, 2020, 2:41am UTC](https://discuss.elastic.co/t/is-there-a-way-to-specify-multiple-cacert-files/245694/2 "2020-08-20T02:41:26Z")

</div>

This is a WAG, but can you try specifying a truststore instead of cacert? It might allow you to have multiple certificates.

---

<div class="post-metadata">

**Author:** ![Qingkun\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qingkun_li/32/55820_2.png) [@Qingkun\_Li](https://discuss.elastic.co/u/Qingkun_Li)\
**Post date:** [August 20, 2020, 3:50am UTC](https://discuss.elastic.co/t/is-there-a-way-to-specify-multiple-cacert-files/245694/3 "2020-08-20T03:50:31Z")

</div>

Is it possible to support multiple cacert in logstash?

Elasticsearch is able to read and use multiple certificates specified in the same .crt file.

---

<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:** [September 17, 2020, 3:50am UTC](https://discuss.elastic.co/t/is-there-a-way-to-specify-multiple-cacert-files/245694/4 "2020-09-17T03:50:35Z")

</div>

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