# Connect to ElasticSearch with HTTPS

**URL:** <https://discuss.elastic.co/t/connect-to-elasticsearch-with-https/242923>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [July 28, 2020, 2:54pm UTC](https://discuss.elastic.co/t/connect-to-elasticsearch-with-https/242923 "2020-07-28T14:54:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![julianksanchez](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@julianksanchez](https://discuss.elastic.co/u/julianksanchez)\
**Post date:** [July 28, 2020, 2:54pm UTC](https://discuss.elastic.co/t/connect-to-elasticsearch-with-https/242923/1 "2020-07-28T14:54:26Z")

</div>

Hello guys,

We are using HTTPS for connection to Elasticsearch. However We are trying to configurate metricbeat in Windows10 and we cant connect to elastic. We have the next configuracion en metricbeat.yml:

> # =================================== Kibana ===================================
> 
> # Kibana Host
> 
> # Scheme and port can be left out and will be set to the default (http and 5601)
> 
> host: "[https://172.16.10.35:5601](https://172.16.10.35:5601)"  
> username: "elastic"  
> password: "xxxxxxx"
> 
> # ---------------------------- Elasticsearch Output ----------------------------
> 
> output.elasticsearch:
> 
> # Array of hosts to connect to.
> 
> hosts: ["[https://172.16.10.35:9200](https://172.16.10.35:9200)"]
> 
> # Protocol - either `http` (default) or `https`.
> 
> #protocol: "https"
> 
> username: "elastic"  
> password: "xxxxxxxx"

Howerver we can run command setup we see the next error:

> PS C:\Program Files\Metricbeat\> .\metricbeat.exe setup  
> Overwriting ILM policy is disabled. Set `setup.ilm.overwrite:true` for enabling.
> 
> Index setup finished.  
> Loading dashboards (Kibana must be running and reachable)  
> Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to [http://localhost:5601/api/status](http://localhost:5601/api/status) fails: fail to execute the HTTP GET request: Get [http://localhost:5601/api/status:](http://localhost:5601/api/status:) dial tcp [::1]:5601: connectex: No se puede establecer una conexión ya que el equipo de destino denegó expresamente dicha conexión.. Response: .  
> PS C:\Program Files\Metricbeat\>

> PS C:\Program Files\Metricbeat\> .\metricbeat.exe setup  
> Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at https://172.16.10.35:9200:9200: Get [https://172.16.10.35:9200](https://172.16.10.35:9200): x509: certificate signed by unknown authority]  
> PS C:\Program Files\Metricbeat\>

Any advice?

---

<div class="post-metadata">

**Author:** ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)\
**Post date:** [July 28, 2020, 3:26pm UTC](https://discuss.elastic.co/t/connect-to-elasticsearch-with-https/242923/2 "2020-07-28T15:26:07Z")

</div>

I believe you need to use certificates that are signed by a trusted authority or configure one as trusted (self-signed certificates). You might be missing this step.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 25, 2020, 5:26pm UTC](https://discuss.elastic.co/t/connect-to-elasticsearch-with-https/242923/3 "2020-08-25T17:26:12Z")

</div>

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