Failed to download the temporary challenge

Dear all, I'm trying to run Certbot without having to stop my web server, but I'm having some issues. I've even tried to create a test path at /opt/tomcat_arcgis_9.0.48/webapps to make sure it was working. Check https://gis.spatialstudieslab.org/.test/index.html. I've also attached the letsencrypt log file.

letsencrypt.txt (26.5 KB)

My domain is: gis.spatialstudieslab.org

I ran this command:
sudo certbot certonly --webroot --webroot-path /opt/tomcat_arcgis_9.0.48/webapps -d gis.spatialstudieslab.org -d www.gis.spatialstudieslab.org -v

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for gis.spatialstudieslab.org and www.gis.spatialstudieslab.org
Performing the following challenges:
http-01 challenge for gis.spatialstudieslab.org
http-01 challenge for www.gis.spatialstudieslab.org
Using the webroot path /opt/tomcat_arcgis_9.0.48/webapps for all unmatched domains.
Waiting for verification...
Challenge failed for domain gis.spatialstudieslab.org
Challenge failed for domain www.gis.spatialstudieslab.org
http-01 challenge for gis.spatialstudieslab.org
http-01 challenge for www.gis.spatialstudieslab.org

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
  Domain: gis.spatialstudieslab.org
  Type:   unauthorized
  Detail: 128.42.130.15: Invalid response from http://gis.spatialstudieslab.org/.well-known/acme-challenge/nTVfbs1a7QQtUj-3py3EdUzu5dZra7qesc-PPwGNlFc: 404

  Domain: www.gis.spatialstudieslab.org
  Type:   unauthorized
  Detail: 128.42.130.15: Invalid response from http://www.gis.spatialstudieslab.org/.well-known/acme-challenge/EI53loU44gRP9hNlokqth-EN9OfMP2Nwo8J_SH-TxeQ: 404

Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.

Cleaning up challenges
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version): Tomcat 9.0.48

The operating system my web server runs on is (include version): Ubuntu 18

My hosting provider, if applicable, is: On-prem

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 1.30.0

Can you try manually create /opt/tomcat_arcgis_9.0.48/webapps/.well-known/index.html and see it at
http://www.gis.spatialstudieslab.org/.well-known/?

7 Likes

Hi @Ualas, and welcome to the LE community forum :slight_smile:

Tomcat can be a bit tricky.

Either: That isn't the correct webroot OR that isn't the right IP.

6 Likes

This might be helpful:
Apache Tomcat 9 (9.0.67) - SSL/TLS Configuration How-To

6 Likes

Hello @_az , I was able to create it manually and it worked at http://www.gis.spatialstudieslab.org/.well-known/

ubr1@gis:/$ sudo mkdir /opt/tomcat_arcgis_9.0.48/webapps/.well-known/
ubr1@gis:/$ sudo nano /opt/tomcat_arcgis_9.0.48/webapps/.well-known/index.html
ubr1@gis:/$ sudo service tomcat_arcgis restart

Thanks for your answer.

1 Like

Hello @rg305, it seems it's the correct webroot, because I've manually created http://www.gis.spatialstudieslab.org/.well-known/ and it's working fine. Regarding the IP address, it's 128.42.130.15 and I can double-check it at DNS Checker - DNS Check Propagation Tool.

After generating the certificates, I'll prepare a pkcs12 keystore and move to the tomcat dir.

Thanks for your answer and for welcoming me.

1 Like

Does it work if you deploy files without the restart?

If Tomcat isn't hot deploying the files when Certbot is creating them, then that could explain the problem.

7 Likes

I've been told that new versions of Tomcat can use the .pem files directly.

6 Likes

Good question. I've just tried to create a new dir without restarting and it worked great.

https://www.gis.spatialstudieslab.org/.well-known2/

Thanks for the advice. I'll check that after I figure out how to make Certbot work.

1 Like

Guys, I've just tried to run certbot standalone with the tomcat stopped and I'm not able to run it successfully.

Commands:

sudo service tomcat_arcgis stop
sudo certbot certonly --standalone -d gis.spatialstudieslab.org -d www.gis.spatialstudieslab.org -v

Output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Requesting a certificate for gis.spatialstudieslab.org and www.gis.spatialstudieslab.org
Performing the following challenges:
http-01 challenge for gis.spatialstudieslab.org
http-01 challenge for www.gis.spatialstudieslab.org
Waiting for verification...
Challenge failed for domain gis.spatialstudieslab.org
Challenge failed for domain www.gis.spatialstudieslab.org
http-01 challenge for gis.spatialstudieslab.org
http-01 challenge for www.gis.spatialstudieslab.org

Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
  Domain: gis.spatialstudieslab.org
  Type:   connection
  Detail: 128.42.130.15: Fetching http://gis.spatialstudieslab.org/.well-known/acme-challenge/sJXRH2Aq6gG8_dqRSQZh6p9xAAdmLXHbgLj98AlZrJ8: Connection refused

  Domain: www.gis.spatialstudieslab.org
  Type:   connection
  Detail: 128.42.130.15: Fetching http://www.gis.spatialstudieslab.org/.well-known/acme-challenge/BGwF8xpdpaI2raVEHvOWXGf51Ooji-gRhb7Z8FVQtak: Connection refused

Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.

Cleaning up challenges
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

Check attached log: letsencrypt_2.txt (25.5 KB)

Could it be related to the following lines of my iptables config?

-A PREROUTING -i ens7 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A PREROUTING -i ens7 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
-A OUTPUT -o lo -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A OUTPUT -o lo -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443

It seems that you would need to run certbot on port 8080.
To do so, try adding:
--http-01-port 8080

5 Likes

It worked great! Thank you @rg305!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.