Letsencrypt problem (permissions on disk?)

AxisNL

Verified User
Joined
Nov 9, 2018
Messages
13
Hey guys and girls, I also have Letsencrypt issues (just saw another post, could be related, did not want to hijack that thread).

I'm an CentOS admin, running some Directadmin 1.61.5 machines. On all machines, I use letsencrypt for the control panel itself (all different hostnames in the same domain). All certificates expired a few hours ago, and I can't renew them because of the dreaded "Error creating new order :: too many certificates already issued for exact set of domains" error.

After some digging around and looking at the issued certs (https://crt.sh/), it looks as though my servers have been requesting new certificates every f*cking day, but somehow now saved these certs on disk. Now I'm hitting LetsEncrypt's rate limits, because my servers requested a new certificate every day, and I can't get another one.

If I look at the files in /etc/httpd/conf/ssl.crt/, I see /etc/httpd/conf/ssl.crt/server.crt was last updated in February, and it contains the expired cert. However, looking at crt.sh, I see letsencrypt succesfully issued a cert. Where is it?

My last succesful cert was issued 15 Feb, and starting April 17th, the new certificates were requested, issued, but never installed. So somewhere in this period, it looks like something changed in DirectAdmin or its helper scripts, preventing new certs from being installed.

Anyone else have any idea how I can fix this? The problem is that I can't test it, because of LetsEncrypt's rate limiting :-/
 
At least I found the correct and issued certificates in /usr/local/directadmin/data/.lego/certificates. I'm now trying to find how I can have letsencrypt use these :D

I see this is the cert:
apachecert=/etc/httpd/conf/ssl.crt/server.crt

And I updated this file, but still directadmin uses some expired one.

# openssl x509 -in /etc/httpd/conf/ssl.crt/server.crt -text | grep After
Not After : Aug 16 21:10:57 2021 GMT
 
Hmm.. somehow DA calls these certs cacerts, even though it's a certificate, nothing to do with a ca.

Copying these files manually worked for now!

# cp /usr/local/directadmin/data/.lego/certificates/server.domain.nl.crt /usr/local/directadmin/conf/cacert.pem
# cp /usr/local/directadmin/data/.lego/certificates/server.domain.nl.key /usr/local/directadmin/conf/cakey.pem
 
update:

cat /usr/local/directadmin/data/.lego/certificates/`hostname`.crt > /usr/local/directadmin/conf/cacert.pem
cat /usr/local/directadmin/data/.lego/certificates/`hostname`.key > /usr/local/directadmin/conf/cakey.pem
systemctl stop directadmin
systemctl start directadmin

cat /usr/local/directadmin/data/.lego/certificates/`hostname`.crt > /etc/httpd/conf/ssl.crt/server.crt
cat /usr/local/directadmin/data/.lego/certificates/`hostname`.key > /etc/httpd/conf/ssl.key/server.key
systemctl stop httpd
systemctl start httpd
 
I think you have hostname added as a domain/subdomain to the server, that's why it placed the certificate to user-directory.
 
Back
Top