Getting Could not communicate with fleet-server Checking API will retry with elastic agent + Squid proxy + Fleet setup

We are running elastic agent in our own aws environment which connect to fleet hosted on elastic cloud via a squid proxy.

While running the elastic agent, it is able to enroll with fleet successfully but then all of a suddent elastic agent dies with following error:
"Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post "https://FLEET_URL:443/api/fleet/agents/c021a75f-e121-467c-9eea-cea250d29bec/checkin?": context canceled"

Everything seems fine but not able to find the root cause of the problem