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

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

For example,

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

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.

1 Like