I'm trying to setup Traefik for https, in docker. But I get the error:
traefik | time="2020-07-10T11:33:46Z" level=error msg="Unable to obtain ACME certificate for domains "my.domain.com": unable to generate a certificate for the domains [my.domain.com]: error: one or more domains had a problem:\n[my.domain.com] acme: error: 403 :: urn:ietf:params:acme:error:unauthorized :: Incorrect validation certificate for tls-alpn-01 challenge. Missing acmeValidationV1 extension., url: \n" routerName=project_name@docker rule="Host(
my.domain.com
)" providerName=myresolver.acme
I have looked for solutions by searching on the terms "Incorrect validation certificate for tls-alpn-01 challenge" and "Missing acmeValidationV1 extension" but haven't been able to find anything that solves my problem.
Here is the complete docker-compose file:
version: "3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.websecure.address=:8082"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=me@email.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "8082:8082"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
project_name:
container_name: project_name
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/app
command: sh -c "uvicorn src.main:app --host=0.0.0.0 --port=8000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.project_name.rule=Host(`my.domain.com`)"
- "traefik.http.routers.project_name.entrypoints=websecure"
- "traefik.http.routers.project_name.tls.certresolver=myresolver"
- "traefik.http.services.project_name.loadbalancer.server.port=8000"