Let's Encrypt for server hostname empty challenge

bertoost

New member
Joined
May 23, 2016
Messages
4
Hi there,

I'm having a weird issue regarding DirectAdmin v1.50.0 and Let's Encrypt.
It's working great for domains controlled via the panel, but I would like to run DA itself on one too.

So I tried to run
Code:
./letsencrypt.sh request {hostname} 4096
but getting an error

Code:
Setting up certificate for a hostname: {hostname}
Getting challenge for {hostname} from acme-server...
./letsencrypt.sh: line 321: /var/www/html/.well-known/acme-challenge/: Is a directory
./letsencrypt.sh: line 324: [: -ne: unary operator expected
Waiting for domain verification...
rm: cannot remove ‘/var/www/html/.well-known/acme-challenge/’: Is a directory
Challenge is . Details: . Exiting...
After some debugging I found the line "CHALLENGE=...." and the "CHALLENGE" variable is empty. But the ${RESPONSE} is filled with some JSON data.
The .well-known folder is reachable via the server it's hostname (on naked domain as well)

Anyone have any clue what I can do to make this work?
Thanks in advance.

Regards, Bert
 

bertoost

New member
Joined
May 23, 2016
Messages
4
Let's encrypt support was marked as BETA in DirectAdmin 1.50: https://www.directadmin.com/features.php?id=1828. That's the reason why a new version of DA hasn't been released just to fix the let's encrypt issue.

To fix the script for DA 1.50 it's enough to change the following line:
Code:
CHALLENGE="`echo "${RESPONSE}" | egrep -o '{[^{]*\"type\":\"http-01\"[^}]*'`"
To:
Code:
CHALLENGE="`echo "${RESPONSE}" | awk '/\"type\": \"http-01\"/,/}/'`"
This and a DNS entry for all my "hostname" subs is fixing it for me. Now running DA over SSL
 
Top