# HTTPS Client Certificate Only Authentication \[ES 6.8\] \[NEST\] \[SSL/TLS\]

**URL:** <https://discuss.elastic.co/t/https-client-certificate-only-authentication-es-6-8-nest-ssl-tls/187218>\
**Category:** Elasticsearch\
**Created:** [June 25, 2019, 2:33am UTC](https://discuss.elastic.co/t/https-client-certificate-only-authentication-es-6-8-nest-ssl-tls/187218 "2019-06-25T02:33:52Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [July 1, 2019, 2:42am UTC](https://discuss.elastic.co/t/https-client-certificate-only-authentication-es-6-8-nest-ssl-tls/187218/5 "2019-07-01T02:42:01Z")

</div>

With NEST or [Elasticsearch.Net](http://Elasticsearch.Net), you can use a certificate for authentication by using the `.ClientCertificate(...)` method on `ConnectionSettings`/`ConnectionConfiguration`, respectively.

For example,

```auto
var settings = new ConnectionSettings(pool)
    .ClientCertificate(@"C:\path_to_cert");

var client = new ElasticClient(settings);

```

or if you need more control over how an `X509Certificate` instance is created

```auto
var settings = new ConnectionSettings(pool)
    .ClientCertificate(new X509Certificate2(@"C:\path_to_cert"));

var client = new ElasticClient(settings);

```

Take a look at the [.NET client documentation on Client Certificates](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/working-with-certificates.html#_client_certificates).

---

_[View the full topic](https://discuss.elastic.co/t/https-client-certificate-only-authentication-es-6-8-nest-ssl-tls/187218)._
