Cloudflare dns cert issue within docker

I'm having same issue, used to use a script to cloudflare-dns refresh certs, today mine ran out and upon running the script i got

An unexpected error occurred:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='acme-v02.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffffa63e7310>: Failed to establish a new connection: [Errno -3] Try again'))

can curl -4 https://acme-v02.api.letsencrypt.org/directory but not curl -6 https://acme-v02.api.letsencrypt.org/directory

I mean from my understanding my server shouldnt even be involved in the process it should just be between cloudflare and letsencrypt

Hi @itsmeArt, and welcome to the LE community forum :slight_smile:

Although your problem may seem related, or even identical to other topics, we prefer to handle topics individually. So, for a comprehensive explanation through conclusion, let's begin with the basic form.


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:

I ran this command:

It produced this output:

My web server is (include version):

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

My hosting provider, if applicable, is:

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

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

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

1 Like

sorry, should have clarified i know some places like to keep related topics together and so wasnt sure if i should open up a new thread, anyway:

domain: arthurtapper.com
ran this command:

docker run -it --rm --name certbot \
-v "/srv/scripts/cfcerts:/etc/letsencrypt" \
-v "/srv/scripts/cloudflare.ini:/cloudflare.ini" \
certbot/dns-cloudflare:arm64v8-latest certonly --dns-cloudflare  \
--dns-cloudflare-credentials /cloudflare.ini \
--dns-cloudflare-propagation-seconds 60 \
-m xxxxx@xxxxx --agree-tos \
-d arthurtapper.com -d \*.arthurtapper.com

produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
An unexpected error occurred:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='acme-v02.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffffa5d081f0>: Failed to establish a new connection: [Errno -3] Try again'))

web server/OS: arch linux (5.11.4-1-ARCH) on raspberry pi 4 (aarch64)
can login to root: yes
client version: latest, just pulled from docker hub (certbot/dns-cloudflare:arm64v8-latest) sha256:b23e07a886a55ca048cbd02840f11a78c5d9a362a9e412514ab1306595d3a968

1 Like

I'd start by checking access from within that container:
curl -4 https://acme-v02.api.letsencrypt.org/directory

Verify the IP, with:
curl ifconfig.co

1 Like

Ok so i'm gonna be honest here I can't really get into the container itself as well it just .. runs, it doesn't allow me to actually get in and run a command. Any suggestions? I've used this exact command multiple times before and well I haven't really changed anything that's whats confusing me. I don't have any outbound firewall rules either. All other containers running fine.

Well, your server needs to connect to the Let's Encrypt endpoint in order to request the certificate, and that error message is saying that it can't. It must be some sort of outbound firewall, or misconfigured routing, or the like, where your container can't connect to Let's Encrypt (and I'm guessing probably can't connect to other sites either).

5 Likes

OK well I have been trying to enter this container to try to run ' curl -4 https://acme-v02.api.letsencrypt.org/directory and curl ifconfig.co for like a day and a half now and just can't get in, is there anywhere you can point me to so I can try to figure this out, I think I've exhausted my googling capabilities here.

Edit: so i tried curl from some other containers and it is an issue, can't resolve host ... I just like haven't changed anything on this server since the last time i got a new cert so it's driving me a little crazy right now

Alright I got it not sure whats going on but i just added --dns 1.1.1.1 and it worked so thank you all for your help!!

1 Like

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