Hi,
I'm having some trouble getting Traefik and Step-CA to work. The routing works correctly, but it falls back to using the default self signed Traefik certificate. The goal is to set up: Build a Tiny Certificate Authority For Your Homelab.
At this point I don't really know what else to try. Anyway, in my Traefik logs I see:
the router whoami@docker uses a non-existent resolver: stepca
I made sure to export the root CA and import it on my Docker host:
step ca root ca.crt
sudo trust anchor --store root.crt
I checked a few other posts on here and don't seem to be making the same mistakes. I'm wondering if it's because I don't have the correct data in acme.json
, I actually don't even know what really goes in there because nowhere I've seen says what to put in that. Even this blog post Traefik+Nextcloud+Step-ca+Docker doesn't say what goes in acme.json
. I looked at these documents:
- Configure popular ACME clients to use a private CA with the ACME protocol: Traefik
- Run your own private CA & ACME server using step-ca
I don't think the problem is with how I am specifying the certresolver. Anyway this is what I have:
whoami:
services:
whoami:
image: "containous/whoami"
container_name: "whoami"
hostname: "whoami"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.tls=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.$MY_DOMAIN`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=stepca"
networks:
default:
external: true
name: ${DEFAULT_NETWORK} ## Note this is traefik-proxy, set in the .env var
traefik:
services:
traefik:
image: traefik:latest
container_name: traefik
hostname: traefik
networks:
- traefik-proxy
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik.yml:/traefik.yml:ro"
- "./traefik_stepca.yml:/etc/traefik/traefik_stepca.yml:ro"
- "./acme.json:/etc/acme/acme.json" # This is an empty file
- "/mnt/container_data/traefik/certs:/etc/traefik/certs:ro"
networks:
traefik-proxy:
external: true
traefik.yml:
log:
level: INFO
api:
insecure: true
dashboard: true
entryPoints:
web:
address: ":80"
# Temporarily disabled redirections
# http:
# redirections:
# entrypoint:
# to: "websecure"
# scheme: "https"
websecure:
address: ":443"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: /etc/traefik/traefik_stepca.yml
traefik_stepca.yml:
certificatesResolvers:
stepca:
acme:
caServer: "https://tinyca.rpi1.home.arpa/acme/acme/directory"
email: "admin@home.arpa"
storage: "/etc/acme/acme.json"
httpChallenge:
entryPoint: web
I checked to see that directory URL can be accessed and it can.