Promtail error: HTTP request to an HTTPS server

I’m trining to setup prom tail with a docker_sd_config scrape config:


  • job_name: docker
    • host: “
      ca_file: /etc/promtail/ca.pem
      cert_file: /etc/promtail/cert.pem
      key_file: /etc/promtail/key.pem

The discovery of the containers is successful but it can’t retrieve the logs and fails with:

level=error ts=2022-04-19T08:06:09.304635232Z caller=target_group.go:95 msg=“added Docker target” containerID=ae0433c80d00aae14fa3428e88a25a431bc36edb88c15a30dc0a7618fe7e3de9
level=error ts=2022-04-19T08:06:09.325492454Z caller=target.go:101 target=docker/ae0433c80d00aae14fa3428e88a25a431bc36edb88c15a30dc0a7618fe7e3de9 msg=“could not fetch logs for container” container=ae0433c80d00aae14fa3428e88a25a431bc36edb88c15a30dc0a7618fe7e3de9 err=“Error response from daemon: Client sent an HTTP request to an HTTPS server.”

Can someone help me? What am I doing wrong. The docker API uses TLS and is exposed on Port 2376. I’m using promtail version 2.5.0