elasticsearch-elixir icon indicating copy to clipboard operation
elasticsearch-elixir copied to clipboard

TLS CLIENT ALERT: Fatal - Unknown CA

Open Sadique-The-Alchemist opened this issue 1 year ago • 2 comments

mix elasticsearch.build posts --cluster Elastic.ElasticsearchCluster responds ** (Mix) Index posts could not be created.

%HTTPoison.Error{reason: {:tls_alert, {:unknown_ca, 'TLS client: In state wait_cert_cr at ssl_handshake.erl:2109 generated CLIENT ALERT: Fatal - Unknown CA\n'}}, id: nil}

Sadique-The-Alchemist avatar Dec 25 '23 07:12 Sadique-The-Alchemist

I installed Elastic Search through Docker and it's initial REST API call to ensure Elastic Search properly installed was curl --cacert http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200 . The mix elasticsearch.build command does not support --cacert as option

Sadique-The-Alchemist avatar Dec 25 '23 08:12 Sadique-The-Alchemist

If you're using OTP26 - https://www.erlang.org/blog/otp-26-highlights/#ssl-safer-defaults Try this in your config:

config :my_app, MyApp.Elasticsearch.Cluster,
  enabled: false,
  default_options: [
    ssl: [{:verify, :verify_none}] #<=== this line
  ],
  api: Elasticsearch.API.HTTP,
  json_library: Jason

I followed the docker compose file setup for cluster, and this seems to work.

lovebes avatar Jan 18 '24 02:01 lovebes