Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1854

ElasticSearch with NEST in Kubernetes

$
0
0

I'm learning Kubernetes and trying to deploy ElasticSearch & Kibana. And in ElasticSearch v8. https is a default.

https://www.elastic.co/guide/en/elasticsearch/client/net-api/7.17/connecting-to-elasticsearch-v8.html

I tried to Index a document like this

var settings = new ConnectionSettings(new Uri("https://localhost:9200"))                        .BasicAuthentication("elastic", "0fjaNokbmHSeS4kXeFV")                        .DefaultIndex("people")                        .RequestTimeout(TimeSpan.FromSeconds(300));var client = new ElasticClient(settings);var person = new Person{    Id = 1,    FirstName = "Abc",    LastName = "Abc"};var indexResponse = client.IndexDocument(person);if (!indexResponse.IsValid){    var debugInfo = indexResponse.DebugInformation;    var error = indexResponse.OriginalException;}

But it does not work. Even I can browse https://localhost:9200 with this credentials elastic/0fjaNokbmHSeS4kXeFV

enter image description here

I tried to add https for my ingress and call the service to IndexDocument but it also did not work.

Has anyone faced this issue and could you please help me to make this run?

The exception throwed from NEST

Invalid NEST response built from a unsuccessful () low level call on PUT: /platforms/_doc/1

Audit trail of this API call:

  • 1 ProductCheckOnStartup: Took: 00:00:00.0501715
  • [2] ProductCheckFailure: Node: https://localhost:9200/ Took: 00:00:00.0484845

OriginalException: Elasticsearch.Net.ElasticsearchClientException: 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 /

---> Elasticsearch.Net.PipelineException: 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.---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch, RemoteCertificateChainErrorsat System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)--- End of inner exception stack trace ---at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)at Elasticsearch.Net.HttpConnection.RequestAsync[TResponse](RequestData requestData, CancellationToken cancellationToken)--- End of inner exception stack trace ---at Elasticsearch.Net.RequestPipeline.ThrowIfTransientProductCheckFailure()at Elasticsearch.Net.RequestPipeline.PingAsync(Node node, CancellationToken cancellationToken)at Elasticsearch.Net.Transport1.PingAsync(IRequestPipeline pipeline, Node node, CancellationToken cancellationToken) at Elasticsearch.Net.Transport1.RequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)--- End of inner exception stack trace ---

Request:

<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

Response:

<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

Thanks & best regards,


Viewing all articles
Browse latest Browse all 1854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>