Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
felixcicatt committed Jul 25, 2024
1 parent abf190f commit 883145c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Kiss.Elastic.Sync/ElasticBulkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ public ElasticBulkClient(Uri baseUri, string username, string password, int scro
{
var handler = new HttpClientHandler();
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
// skip checking the certificate because we run Elastic internally, with a local certificate
handler.ServerCertificateCustomValidationCallback = (a, b, c, d) => true;
_httpClient = new HttpClient(handler);
_httpClient.BaseAddress = baseUri;
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Helpers.EncodeCredential(username, password));
var clientSettings = new ElasticsearchClientSettings(baseUri)
.Authentication(new BasicAuthentication(username, password))
// skip checking the certificate because we run Elastic internally, with a local certificate
.ServerCertificateValidationCallback((a, b, c, d) => true);

_elasticsearchClient = new ElasticsearchClient(clientSettings);
Expand Down

0 comments on commit 883145c

Please sign in to comment.