I have multiple domain providers, in my case, DuckDNS and Cloudflare. I would like to retrieve certificates for both. In trying to do this, I passed in the following flags into my Traefik v2 container:
# DuckDNS
- --entrypoints.websecure.http.tls.certresolver=duckdns
- --entrypoints.websecure.http.tls.domains[0].main=${FQDN}
- --entrypoints.websecure.http.tls.domains[0].sans=*.${FQDN}
- --certificatesresolvers.duckdns.acme.email=${EMAIL}
- --certificatesresolvers.duckdns.acme.storage=/etc/traefik/acme/acme.json
- --certificatesresolvers.duckdns.acme.dnschallenge.provider=duckdns
- --certificatesresolvers.duckdns.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53
- --certificatesresolvers.duckdns.acme.dnschallenge.delayBeforeCheck=90
# Cloudflare
- --entrypoints.websecure2.http.tls.certresolver=cloudflare
- --entrypoints.websecure2.http.tls.domains[0].main=${FQDN2}
- --entrypoints.websecure2.http.tls.domains[0].sans=*.${FQDN2}
- --certificatesresolvers.cloudflare.acme.email=${EMAIL}
- --certificatesresolvers.cloudflare.acme.storage=/etc/traefik/acme/acme.json
- --certificatesresolvers.cloudflare.acme.dnschallenge=true
- --certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare
- --certificatesresolvers.cloudflare.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53
- --certificatesresolvers.cloudflare.acme.dnschallenge.delayBeforeCheck=90
Then for environment variables, I set:
- DUCKDNS_TOKEN=${DUCKDNS_TOKEN}
- CF_API_EMAIL=${CF_API_EMAIL}
- CF_API_KEY=${CF_API_KEY}
Now, when I run the container, the only certificate that is retrieved is for my DuckDNS domains. Whereas the entries for Cloudflare just have null values.
Example of acme.json:
{
"cloudflare": {
"Account": null,
"Certificates": null
},
"duckdns": {
"Account": {
"Email": "---REDACTED---",
"Registration": {
"body": {
"status": "valid",
"contact": [
"mailto:---REDACTED---"
]
},
"uri": "---REDACTED---"
},
"PrivateKey": "---REDACTED---",
"KeyType": "4096"
},
"Certificates": [
{
"domain": {
"main": "---REDACTED---.duckdns.org",
"sans": [
"*.---REDACTED---.duckdns.org"
]
},
"certificate": "---REDACTED---",
"key": "---REDACTED---",
"Store": "default"
}
]
}
}
How can I retrieve certificates that are valid for multiple domain providers?