Metricbeat, http: server gave HTTP response to HTTPS client

Hi all,
I am trying to activate basic security http in my ELK stack. My Elasticsearch version is 7.16.1. I create and add related files to config folder of Elasticsearch and kibana. Also I add below steps to Elasticsearch.yml: elastic-certificates.p12 true http.p12

and kibana.yml (kibana version is 7.13.1):

elasticsearch.ssl.certificateAuthorities: C:\ELK\kibana-7.13.1-windows-x86_64\kibana-7.13.1-windows-x86_64\config\elasticsearch-ca.pem

When I start elasticserach and kibana, every thing is ok and they are up.
At the next step, I am trying to do same things in the case of metricbeat, I copy "Elasticsearch-ca.pem" to metricbeat folder and add following to Elasticsearch output of metricbeat.yml:

  # Array of hosts to connect to.
  hosts: [""]
   - index: "metric-%{+yyyy.MM}"
  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  username: "elastic"
  password: "**"
    certificate_authorities: ["elasticsearch-ca.pem"]
    verification_mode: "certificate"

But, when I start metricbeat, following error has been found:

2021-12-14T19:28:22.315+0330    ERROR   [publisher_pipeline_output]     pipeline
/output.go:154  Failed to connect to backoff(elasticsearch( Get "": http: server gave HTTP response to HTTPS cl

Any advise will be so appreciated.


Could you try with just hosts: [""] in the config?

Dear Kaiyan
Many thanks for your reply. It works in the case of http but I need to activate tls in the communication between metricbeat and elasticserach and it is needed to use https. I will be so appreciated if you can advice me about this.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.