Cloudflare DNS challenge API issues

I have setup the Cloudflare API and added it to a letsencrupt.ini file. When I ran the CURL command Cloudflare provides directly after creating the API Token, it worked, but when I run certbot, it fails

My domain is: my.domain.com

I ran this command: sudo certbot -v certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini -d my.domain.com

It produced this output: Error determining zone_id: 6003 Invalid request headers. Please confirm that you have supplied valid Cloudflare API credentials. (Did you copy your entire API token/key? To use Cloudflare tokens, you'll need the python package cloudflare>=2.3.1. This certbot is running cloudflare 2.11.1)

My web server is (include version): Nginx

The operating system my web server runs on is (include version): Ubuntu 24.04 TLS

My hosting provider, if applicable, is: self

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 2.9.0

Make sure you've entered detail to the cloudflare.ini file correctly.
If you used API Token (recommended) check for proper permissions.

See: Welcome to certbot-dns-cloudflare’s documentation! — certbot-dns-cloudflare 0 documentation

2 Likes

Literally justy found simiolar thread and solution.

If you are using a scoped API token, then your gldn.ini should only contain dns_cloudflare_api_token.

Don't include dns_cloudflare_email or dns_cloudflare_api_key.

Working fine now!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.