Elastic agent is unable to enroll to fleet

I tried without using --insecure for http it gives an error and prompts to use --insecure.
curl command is actually not working in the windows server I am using. but I tried accessing http://fleet server ip:8220 from the browser and it gives an error "cannot reach this page"