Terraform 0.15.1 through https proxy

We use Terraform Cloud and have installed a set of agents in the private enterprise. These agents reach out to the Terraform Cloud through a HTTPS proxy.
We are seeing that most of the times the jobs go through fine. But when there is a failure, we are seeing the following error message in the Terraform agent Logs. Couple of them are listed below.

2021-04-30T12:30:35.446Z [ERROR] core: Failed requesting job: error=“failed fetching jobs: Get “https://app.terraform.io/api/agent/jobs”: http: server gave HTTP response to HTTPS client”

2021-04-30T10:03:41.749Z [DEBUG] terraform: Running command: cmd="/root/.tfc-agent/component/terraform/runs/run-X4KjgTJWijxYWy4d.plan/bin/terraform plan -out=/root/.tfc-agent/component/terraform/runs/run-X4KjgTJWijxYWy4d.plan/config/terraform.tfplan -var-file=/root/.tfc-agent/component/terraform/runs/run-X4KjgTJWijxYWy4d.plan/terraform.tfvars -detailed-exitcode -lock=false"
2021-04-30T10:03:42.819Z [DEBUG] terraform.cli:
2021-04-30T10:03:42.819Z [DEBUG] terraform.cli:Error: Failed to request discovery document: Get “https://app.terraform.io/.well-known/terraform.json”: http: server gave HTTP response to HTTPS client