Topic: LetsEncrypt not able to download certificate files
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer?: downloadable installer
- Linux/BSD distribution name and version: CentOS Linux release 7.6.1810 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi,
I'm setting up a new server with iRedMail. I'm at this moment stuck in the steps written here: https://docs.iredmail.org/letsencrypt.html
When requesting a new certificate (with option --dry-run), an error message appears:
Challenge failed for domain mail02.hostingkruidenier.nl
http-01 challenge for mail02.hostingkruidenier.nl
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: mail02.hostingkruidenier.nl
Type: connection
Detail: Fetching
https://<domain>/.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM:
Connection refused
To check what is going on, I added the --debug-challenges flag:
certbot certonly --webroot -w /var/www/html -d <domain> --dry-run --debug-challenges
A file is created in /var/www/html/.well-known/acme-challenge.
I am able to download that file, however:
curl -k http://<domain>/.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM
gives:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
curl -k https://<domain>/.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM
gives the response I need, the content of the file.
When I check the access.log file from Nginx, I can see a 301 is being served for the first request, nothing is logged (so a 200) for the second request.
When I hit enter after the certbot command, I see these 4 entries being added to the access.log file:
52.29.173.72 - - [07/Jul/2019:12:51:39 +0200] "GET /.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM HTTP/1.1" 301 178 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
13.58.30.69 - - [07/Jul/2019:12:51:39 +0200] "GET /.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM HTTP/1.1" 301 178 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
66.133.109.36 - - [07/Jul/2019:12:51:40 +0200] "GET /.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM HTTP/1.1" 301 178 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
34.213.106.112 - - [07/Jul/2019:12:51:40 +0200] "GET /.well-known/acme-challenge/37R8lh6XO97d8WUPKriV6T3k9X2zDtTQi7Un3cuJ2sM HTTP/1.1" 301 178 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
Does that mean that letsencrypt is not following up the 301 to https? Or does letsencrypt require a http instead of a https connection?
In both cases, what can I do to get this working and/or find the cause?
Regards,
Rinze
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.