# Error: fail to enroll: fail to execute request to fleet-server: http: server gave HTTP response to HTTPS client

**URL:** <https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678>\
**Category:** Elastic Agent\
**Created:** [December 5, 2023, 8:45pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678 "2023-12-05T20:45:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virtual\_Box](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/virtual_box/32/122402_2.png) [@Virtual\_Box](https://discuss.elastic.co/u/Virtual_Box)\
**Post date:** [December 5, 2023, 8:45pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678/1 "2023-12-05T20:45:18Z")

</div>

Hey there,  
I've tried to install elastic-agent on ubuntu host and get the next error:

```auto
Enrolling Elastic Agent with Fleet...{"log.level":"warn","@timestamp":"2023-12-05T20:38:37.405Z","log.logger":"tls","log.origin":{"file.name":"tlscommon/tls_config.go","file.line":107},"message":"SSL/TLS verifications disabled.","ecs.version":"1.6.0"}
.{"log.level":"info","@timestamp":"2023-12-05T20:38:38.059Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":479},"message":"Starting enrollment to URL: https://10.101.16.154:8220/","ecs.version":"1.6.0"}
...........................................................................................................................................................................................................................Error: fail to enroll: fail to execute request to fleet-server: http: server gave HTTP response to HTTPS client
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.11/fleet-troubleshooting.html
 FAILED
Stopping service... DONE
Uninstalling...
   Stopping service... DONE
   Stopping upgrade watcher; none found... DONE
.. Removing service.... DONE
   Removing install directory... DONE
   DONE
Error: enroll command failed for unknown reason: exit status 1
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.11/fleet-troubleshooting.html

```

My initial command was:

```auto
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.11.0-linux-x86_64.tar.gz
tar xzvf elastic-agent-8.11.0-linux-x86_64.tar.gz
cd elastic-agent-8.11.0-linux-x86_64
sudo ./elastic-agent install --url=https://x.x.x.x:8220 --enrollment-token=SzBhRE9vd0JvVnRmeTI5eENPbmk6UzNnZ2ZVazBRMW1hZGtNTEkxWU45dw== --insecure

```

Could you please help me? How can I solve this problem?

---

<div class="post-metadata">

**Author:** ![carter.kovrov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carter.kovrov/32/122447_2.png) [@carter.kovrov](https://discuss.elastic.co/u/carter.kovrov)\
**Post date:** [December 5, 2023, 8:52pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678/2 "2023-12-05T20:52:25Z")

</div>

> [@Virtual\_Box](#):
>
> `http: server gave HTTP response to HTTPS client`

judging by the log it is necessary to use --url http instead of https

---

<div class="post-metadata">

**Author:** ![Virtual\_Box](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/virtual_box/32/122402_2.png) [@Virtual\_Box](https://discuss.elastic.co/u/Virtual_Box)\
**Post date:** [December 6, 2023, 1:23pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678/4 "2023-12-06T13:23:21Z")

</div>

> [@Virtual\_Box](#):
>
> Unfortunately this one does not work

> [@carter.kovrov](#):
>
> > [@Virtual\_Box](#):
> >
> > `http: server gave HTTP response to HTTPS client`
> 
> judging by the log it is necessary to use --url http instead of https

Unfortunately this one does not work

---

<div class="post-metadata">

**Author:** ![Virtual\_Box](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/virtual_box/32/122402_2.png) [@Virtual\_Box](https://discuss.elastic.co/u/Virtual_Box)\
**Post date:** [December 9, 2023, 6:47pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678/5 "2023-12-09T18:47:56Z")

</div>

I've solved my problem. Proxy server blocked connection from host to fleet server. It was my bad and stupid mistake. Thanks a lot, pay attention to another deviices between hosts and fleet server.

---

<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:** [January 6, 2024, 6:48pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-http-server-gave-http-response-to-https-client/348678/6 "2024-01-06T18:48:17Z")

</div>

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