# Ansible-Elasticsearch custom CA certificate validation failures

**URL:** <https://discuss.elastic.co/t/ansible-elasticsearch-custom-ca-certificate-validation-failures/216843>\
**Category:** Elasticsearch\
**Created:** [January 28, 2020, 1:28pm UTC](https://discuss.elastic.co/t/ansible-elasticsearch-custom-ca-certificate-validation-failures/216843 "2020-01-28T13:28:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernhard.fluehmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bernhard.fluehmann/32/71755_2.png) [@bernhard.fluehmann](https://discuss.elastic.co/u/bernhard.fluehmann)\
**Post date:** [January 28, 2020, 1:28pm UTC](https://discuss.elastic.co/t/ansible-elasticsearch-custom-ca-certificate-validation-failures/216843/1 "2020-01-28T13:28:45Z")

</div>

If Elasticsearch is installed with Ansible and a custom CA is used, the installation fails when es\_validate\_certs is true. The reason is that Ansible just copies the CA from the Ansible host to the nodes certificate directory (/etc/elasticsearch/certs). This breaks Ansible uri calls, since uri does not have an option to specify specific CAs (like cacert option in CURL). In order to make certificate validation work, the CA certificate needs to be added to the main ca-certification bundle, which is different for e.g. Debian or Redhat Systems. One other way would be use of curl, which provides the option of specifying the Certificate.

Regards  
Bernhard

---

<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:** [February 25, 2020, 1:28pm UTC](https://discuss.elastic.co/t/ansible-elasticsearch-custom-ca-certificate-validation-failures/216843/2 "2020-02-25T13:28:46Z")

</div>

Closed on February 25, 2020, 1:28pm UTC

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

---

<div class="post-metadata">

**Author:** ![Julien\_MAILLERET](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien_mailleret/32/45074_2.png) [@Julien\_MAILLERET](https://discuss.elastic.co/u/Julien_MAILLERET)\
**Post date:** [March 6, 2020, 3:08pm UTC](https://discuss.elastic.co/t/ansible-elasticsearch-custom-ca-certificate-validation-failures/216843/3 "2020-03-06T15:08:09Z")

</div>

Hi @bernhard.fluehmann, thanks for reporting this problem.  
Could you create an issue in [https://github.com/elastic/ansible-elasticsearch/issues/new](https://github.com/elastic/ansible-elasticsearch/issues/new)?
