I’ve compiled caddy master again with:
> xcaddy build master --with github.com/caddy-dns/cloudflare
Version commit appears to be correct:
> ./caddy version
v2.2.0-rc.1.0.20200908173646-00e6b77fe4ebh1:l5u8lY5VzBmu0cBjZ7dTXbCg3bAAapjQxzhJs+AjlVs=
But given this Caddyfile as suggested:
test1.carloscarrasco.com {
tls {
dns cloudflare XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
issuer acme {
dir https://acme-staging-v02.api.letsencrypt.org/directory
resolvers 1.0.0.1
}
}
respond "testing"
}
I still get the same error:
> ./caddy adapt
2020/09/09 11:15:54.867 INFO using adjacent Caddyfile
adapt: parsing caddyfile tokens for 'tls': Caddyfile:8 - Error during parsing: when defining an issuer, all its config must be in its block, rather than from separate tls subdirectives
I then moved the dns directive into the issuer block, as this:
test1.carloscarrasco.com {
tls {
issuer acme {
dir https://acme-staging-v02.api.letsencrypt.org/directory
dns cloudflare XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
resolvers 1.0.0.1
}
}
respond "testing"
}
And this time the Caddyfile is accepted, but the resulting JSON does not mention any custom resolver:
./caddy adapt
2020/09/09 11:25:16.581 INFO using adjacent Caddyfile
{"apps":{"http":{"servers":{"srv0":{"listen":[":443"],"routes":[{"match":[{"host":["test1.carloscarrasco.com"]}],"handle":[{"handler":"subroute","routes":[{"handle":[{"body":"testing","handler":"static_response"}]}]}],"terminal":true}]}}},"tls":{"automation":{"policies":[{"subjects":["test1.carloscarrasco.com"],"issuer":{"ca":"https://acme-staging-v02.api.letsencrypt.org/directory","challenges":{"dns":{"provider":{"api_token":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","name":"cloudflare"}}},"module":"acme"}}]}}}}
So I guess that’s why the resolver is still not working.