# Failed to connect to backoff(elasticsearch(http://localhost:9200))

**URL:** <https://discuss.elastic.co/t/failed-to-connect-to-backoff-elasticsearch-http-localhost-9200/325065>\
**Category:** Elastic Observability\
**Tags:** fleet\
**Created:** [February 8, 2023, 8:52pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-backoff-elasticsearch-http-localhost-9200/325065 "2023-02-08T20:52:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fnbk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fnbk/32/116886_2.png) [@fnbk](https://discuss.elastic.co/u/fnbk)\
**Post date:** [February 8, 2023, 8:52pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-backoff-elasticsearch-http-localhost-9200/325065/1 "2023-02-08T20:52:15Z")

</div>

I setup Elasticsearch version 8.6.1 the default way which generates self signed certificates so that the Elasticsearch endpoint uses **https** ([https://localhost:9200](https://localhost:9200)).

I installed the elastic-agent as a windows service using the command generated from Kibana UI:

> .\elastic-agent.exe install  
> --fleet-server-es=[https://localhost:9200](https://localhost:9200)  
> --fleet-server-service-token=xxx  
> --fleet-server-policy=fleet-server-policy

When looking into the logs I get the error message in C:\Program Files\Elastic\Agent\elastic-agent-20230208.ndjson

> Failed to connect to backoff(elasticsearch([http://localhost:9200](http://localhost:9200)))

1. I am wondering why the agent uses **http** and not **https**? (I specified https in the install command above)
2. Where can I make these changes? (I tried to edit "C:\Program Files\Elastic\Agent\elastic-agent.yml" and restart the "Elastic Agent" service.)

---

<div class="post-metadata">

**Author:** ![fnbk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fnbk/32/116886_2.png) [@fnbk](https://discuss.elastic.co/u/fnbk)\
**Post date:** [February 8, 2023, 9:27pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-backoff-elasticsearch-http-localhost-9200/325065/2 "2023-02-08T21:27:53Z")

</div>

I solved it - please refer to this answer: [How do I setup APM all on one machine?](https://discuss.elastic.co/t/how-do-i-setup-apm-all-on-one-machine/324922/4)
