Lets Encrypt / Dehydrated retry – August 02, 2022

I get sporadic errors when running dehydrated -c from my regular cron job.  The errors I get vary from time to time, but they are:

ERROR: Problem connecting to server (get for https://acme-v02.api.letsencrypt.org/directory; curl returned with 35)
ERROR: Problem connecting to server (post for https://acme-v02.api.letsencrypt.org/acme/authz-v3/xxxx; curl returned with 35)

It seems to happen to some servers more than others, particularly newer ones (Debian 11).

I added this to /etc/dehydrated/conf.d/retry.sh

CURL_OPTS="--retry 3 --retry-all-errors"

dehydrated --version outputs:

Dehydrated version: 0.7.0
GIT-Revision: unknown
OS: Debian GNU/Linux 11 (bullseye)
Used software:
 bash: 5.1.4(1)-release
 curl: 7.74.0
 awk: GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
 sed: sed (GNU sed) 4.7
 mktemp: mktemp (GNU coreutils) 8.32
 grep: grep (GNU grep) 3.6
 diff: diff (GNU diffutils) 3.7
 openssl: OpenSSL 1.1.1n  15 Mar 2022

Hope this saves you some frustration, as I don't see anyone talking about this fix yet (though some bug reports talk about putting something similar into dehydrated once they support the newer versions of cURL (you can't use --retry until version 7.12.3 and --retry-all-errors was added in 7.71.0)