The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call

Viewed 2747

I Use ElasticSearch 8.1.2 and Nest 17.7.1

var settings = new ConnectionSettings(new Uri("http://localhost:9200/"))
            .CertificateFingerprint("A5:8B:07:2D:A9:E8:53:CE:GB:C0:15:CE:6E:DF:9C:65:89:A3:AC:D2:94:2C:46:BD:85:23:20:6B:F2:69:B3:88")
            .BasicAuthentication("elastic", "-L-uXRg5=iOXGFgebP68")                  
            .DeadTimeout(TimeSpan.FromSeconds(300))
            .DefaultIndex("people");
var client = new ElasticClient(settings);
var person = new Person
{
    Id = 1,
    FirstName = "Martijn",
    LastName = "Laarman"
};
var asyncIndexResponse = await client.IndexDocumentAsync(person);
return Task.CompletedTask;

But I have Error enter image description here

error message: Message = "The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. Call: Status code unknown from: GET /"

1 Answers

Enable the compatibility header in the connection settings:

settings.EnableApiVersioningHeader(); // enable ES 7.x compatibility on ES 8.x servers

Docu here under Enabling Compatibility Mode

Related