Invalid token with cloudflare

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

flatstore.dchbk.us

I ran this command:

./acme.sh --renew -d flatstor.dchbk.us --dns dns_cf --force --debug 2

It produced this output:

The debug log tells me:

[Sun Dec 28 20:28:34 EST 2025] response='{"success":false,"errors":[{"code":9109,"message":"Invalid access token"}],"messages":,"result":null}'

The token that shows up in the debug log is not the correct token, namely, the token that is in account.conf.

Try setting the env variable and see if that works: dnsapi · acmesh-official/acme.sh Wiki · GitHub

3 Likes

The problem turned out to be bad values in the flatstor.dchbk.us.conf file. Once those were wrong, nothing seemed to be updating them from the environment variables or account.conf. Once I put correct IDs in there, everything worked.

Do you take doc contributions? I could write up some hints for the next person.

Would those be doc suggestions for the acme.sh product?

If so, submit those at their github: GitHub - acmesh-official/acme.sh: A pure Unix shell script ACME client for SSL / TLS certificate automation

3 Likes