Letsencrypt only fails on subdomain webmail [SOLVED]

edvanleeuwen

Verified User
Joined
Nov 18, 2013
Messages
148
Until July renewing of the webmail subdomain worked. Now I am getting the following error:

Challenge pre-checks for http://webmail.mydomain.com/.well-known/acme-challenge/letsencrypt_1593848923 failed... Command:
/usr/local/bin/curl --connect-timeout 40 -k --silent --resolve webmail.mydomain.com:80:194.145.200.999 --resolve webmail.mydomain.com:443:194.145.200.999 -I -L -X GET http://webmail.mydomain.com/.well-known/acme-challenge/letsencrypt_1593848923
Exiting.

When I execute the curl command manually, there are no errors. Renewal works for other entries, e.g. www.

I have followed the steps in https://help.directadmin.com/item.php?id=646. Up to the 4th step is correct. The 4th step gives me:

[root@s1 ~]# /usr/local/bin/curl -I -L -k -X GET http://webmail.domain.nl/.well-known/acme-challenge/test.txt
HTTP/1.1 302 Found
Date: Fri, 10 Jul 2020 15:36:42 GMT
Server: Apache/2
Location: https://webmail.domain.nl.well-known/acme-challenge/test.txt
Content-Length: 242
Content-Type: text/html; charset=iso-8859-1

curl: (6) Could not resolve host: webmail.domain.nl.well-known

It seems that curl is not acting properly on the '/.' combination.

curl version: 7.70.0
letsencrypt version: 2.0.5

Any ideas?
 
The problem was that I added the following to my custom virtual_host2.conf:

<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
ServerName |PREFIX_DOMAIN||DOMAIN|
ServerAlias |PREFIX_DOMAIN||DOMAIN| |DOMAIN| |SERVER_ALIASES|
Redirect "/" "https://|PREFIX_DOMAIN||DOMAIN|"

|CUSTOM4|
</VirtualHost>

(I use PREFIX_DOMAIN in order to switch between www and non-www.)

I had to add a / to the Redirect:

<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
ServerName |PREFIX_DOMAIN||DOMAIN|
ServerAlias |PREFIX_DOMAIN||DOMAIN| |DOMAIN| |SERVER_ALIASES|
Redirect "/" "https://|PREFIX_DOMAIN||DOMAIN|/"
|CUSTOM4|
</VirtualHost>
 
Back
Top