I’m not really sure what’s going on. I followed this guide:
First Created this token with Zone.DNS.Edit
Second I used this Cloudflare plugin to create a Dockerfile:
FROM caddy:builder AS builder
RUN xcaddy build \
--with github.com/caddy-dns/cloudflare
FROM caddy:latest
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
And finally set this in Caddyfile
www.example.com {
tls {
dns cloudflare TOKEN_HASH
}
respond "Hello world"
}
Debug logs:
{"level":"info","ts":1723134951.0599442,"logger":"tls.obtain","msg":"obtaining certificate","identifier":" www.example.com"}
{"level":"debug","ts":1723134951.0601518,"logger":"events","msg":"event","name":"cert_obtaining","id":"ad49c093-209f-441c-acff-9b81367a9f20","origin":"tls","data":{"identifier":" www.example.com"}}
{"level":"debug","ts":1723134951.0606673,"logger":"tls.obtain","msg":"trying issuer 1/1","issuer":"acme-v02.api.letsencrypt.org-directory"}
{"level":"info","ts":1723134951.0614405,"logger":"tls.issuance.acme","msg":"waiting on internal rate limiter","identifiers":[" www.example.com"],"ca":"https://acme-v02.api.letsencrypt.org/directory","account":""}
{"level":"info","ts":1723134951.0614672,"logger":"tls.issuance.acme","msg":"done waiting on internal rate limiter","identifiers":[" www.example.com"],"ca":"https://acme-v02.api.letsencrypt.org/directory","account":""}
{"level":"info","ts":1723134951.061483,"logger":"tls.issuance.acme","msg":"using ACME account","account_id":"https://acme-v02.api.letsencrypt.org/acme/acct/1875290417","account_contact":[]}
{"level":"debug","ts":1723134951.5227635,"logger":"tls.issuance.acme.acme_client","msg":"http request","method":"GET","url":"https://acme-v02.api.letsencrypt.org/directory","headers":{"User-Agent":["Caddy/2.8.4 CertMagic acmez (linux; amd64)"]},"response_headers":{"Cache-Control":["public, max-age=0, no-cache"],"Content-Length":["746"],"Content-Type":["application/json"],"Date":["Thu, 08 Aug 2024 16:35:51 GMT"],"Server":["nginx"],"Strict-Transport-Security":["max-age=604800"],"X-Frame-Options":["DENY"]},"status_code":200}
{"level":"debug","ts":1723134951.523017,"logger":"tls.issuance.acme.acme_client","msg":"creating order","account":"https://acme-v02.api.letsencrypt.org/acme/acct/1875290417","identifiers":[" www.example.com"]}
{"level":"debug","ts":1723134951.6764255,"logger":"tls.issuance.acme.acme_client","msg":"http request","method":"HEAD","url":"https://acme-v02.api.letsencrypt.org/acme/new-nonce","headers":{"User-Agent":["Caddy/2.8.4 CertMagic acmez (linux; amd64)"]},"response_headers":{"Cache-Control":["public, max-age=0, no-cache"],"Date":["Thu, 08 Aug 2024 16:35:51 GMT"],"Link":["<https://acme-v02.api.letsencrypt.org/directory>;rel=\"index\""],"Replay-Nonce":["cgBcsAuLOj4gvW--rJyh3_4oxPK-ad-ZBJoLOFAsds2sdyKTM3k"],"Server":["nginx"],"Strict-Transport-Security":["max-age=604800"],"X-Frame-Options":["DENY"]},"status_code":200}
{"level":"debug","ts":1723134951.9200969,"logger":"tls.issuance.acme.acme_client","msg":"http request","method":"POST","url":"https://acme-v02.api.letsencrypt.org/acme/new-order","headers":{"Content-Type":["application/jose+json"],"User-Agent":["Caddy/2.8.4 CertMagic acmez (linux; amd64)"]},"response_headers":{"Boulder-Requester":["1875290417"],"Cache-Control":["public, max-age=0, no-cache"],"Content-Length":["346"],"Content-Type":["application/json"],"Date":["Thu, 08 Aug 2024 16:35:51 GMT"],"Link":["<https://acme-v02.api.letsencrypt.org/directory>;rel=\"index\""],"Location":["https://acme-v02.api.letsencrypt.org/acme/order/1875290417/3243141234123"],"Replay-Nonce":["..."],"Server":["nginx"],"Strict-Transport-Security":["max-age=604800"],"X-Frame-Options":["DENY"]},"status_code":201}
{"level":"debug","ts":1723134952.0787663,"logger":"tls.issuance.acme.acme_client","msg":"http request","method":"POST","url":"https://acme-v02.api.letsencrypt.org/acme/authz-v3/387725450456","headers":{"Content-Type":["application/jose+json"],"User-Agent":["Caddy/2.8.4 CertMagic acmez (linux; amd64)"]},"response_headers":{"Boulder-Requester":["1875290417"],"Cache-Control":["public, max-age=0, no-cache"],"Content-Length":["804"],"Content-Type":["application/json"],"Date":["Thu, 08 Aug 2024 16:35:52 GMT"],"Link":["<https://acme-v02.api.letsencrypt.org/directory>;rel=\"index\""],"Replay-Nonce":["cgBcsAuLaCxEE75upD4PPUIE0UJM7B16hXtLgXT6EgdEHNmsFks"],"Server":["nginx"],"Strict-Transport-Security":["max-age=604800"],"X-Frame-Options":["DENY"]},"status_code":200}
{"level":"debug","ts":1723134952.0789962,"logger":"tls.issuance.acme.acme_client","msg":"no solver configured","challenge_type":"tls-alpn-01"}
{"level":"debug","ts":1723134952.0790045,"logger":"tls.issuance.acme.acme_client","msg":"no solver configured","challenge_type":"http-01"}
{"level":"info","ts":1723134952.0790095,"logger":"tls.issuance.acme.acme_client","msg":"trying to solve challenge","identifier":" www.example.com","challenge_type":"dns-01","ca":"https://acme-v02.api.letsencrypt.org/directory"}
{"level":"debug","ts":1723134953.5648632,"logger":"tls.issuance.acme.acme_client","msg":"waiting for solver before continuing","identifier":" www.example.com","challenge_type":"dns-01"}
{"level":"debug","ts":1723134963.2078462,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.com"}
{"level":"debug","ts":1723134963.207852,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.*"}