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

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

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:

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?

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

1 Like

Unfortunately this one does not work

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.

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