Error while adding an agent

Course: Observability
Version: v 8.8.2
Question: I had to reset my lab and restart the lab from the beginning. While trying to add an agent, I get an error like below so that I cannot go forward because all lab courses depend on the agent. If I paste the original error message, I get an error saying I cannot post lint to that host. So, I removed URL like strings.

elastic@ip-172-31-28-230:~/elastic-agent-8.8.2-linux-x86_64$ sudo ./elastic-agent install --url=…fleet-server:8220 --enrollment-token=TG5QWHFwa0JJTVVSV1h4cVc3azU6al9WbFRMVW1TbEMydm9NN21fRC1Zdw==
Elastic Agent will be installed at /opt/Elastic/Agent and will run as a service. Do you want to continue? [Y/n]:Y
{"log.level":"info","@timestamp":"2025-10-06T15:58:02.922Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":478},"message":"Starting enrollment to URL: …fleet-server:8220/","ecs.version":"1.6.0"}
Error: fail to enroll: fail to execute request to fleet-server: x509: certificate signed by unknown authority
For help, please see our troubleshooting guide at Troubleshoot common problems | Fleet and Elastic Agent Guide [8.8] | Elastic
Error: enroll command failed with exit code: 1
For help, please see our troubleshooting guide at Troubleshoot common problems | Fleet and Elastic Agent Guide [8.8] | Elastic