# Using certificates with ElasticSearch Nest client?

**URL:** <https://discuss.elastic.co/t/using-certificates-with-elasticsearch-nest-client/284656>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 20, 2021, 7:39pm UTC](https://discuss.elastic.co/t/using-certificates-with-elasticsearch-nest-client/284656 "2021-09-20T19:39:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bensalerno](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bensalerno](https://discuss.elastic.co/u/bensalerno)\
**Post date:** [September 20, 2021, 7:39pm UTC](https://discuss.elastic.co/t/using-certificates-with-elasticsearch-nest-client/284656/1 "2021-09-20T19:39:00Z")

</div>

I am attempting to connect to an ElasticSearch cluster using a set of certificates given to me and a username + password.

I have

- ca-chain
- public certificate
- private key

I started my code out like this:

```auto
var settings = new ConnectionSettings(new Uri("http://server"))
                .DefaultIndex("people")
                .BasicAuthentication("usr", "pw");

```

However, I am not sure how to include my 3 certificates. Is there a simple way to include these in the ConnectionSettings?

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [September 21, 2021, 12:14pm UTC](https://discuss.elastic.co/t/using-certificates-with-elasticsearch-nest-client/284656/2 "2021-09-21T12:14:20Z")

</div>

Hi @bensalerno,

This [answer from a similar post](https://discuss.elastic.co/t/https-client-certificate-only-authentication-es-6-8-nest-ssl-tls/187218/5) may help you get started configuring client certificates.

Steve

---

<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 19, 2021, 12:14pm UTC](https://discuss.elastic.co/t/using-certificates-with-elasticsearch-nest-client/284656/3 "2021-10-19T12:14:28Z")

</div>

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