I have been using letsencrypt client for my domain using TLS-SNI-01 without any issues. With support being removed for TLS-SNI-01 and having a version that was not upgradeable I decided to switch to certbot client and use HTTP challenge instead.
My domain is: apps dot twexxt dot com
I ran this command: sudo /usr/bin/certbot --apache --preferred-challenges http
It produced this output:
You have an existing certificate that has exactly the same domains or certificate name you requested and isn’t close to expiry.
(ref: /etc/letsencrypt/renewal/apps.twexxt.com.conf)
What would you like to do?
1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)
Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for apps.twexxt.com
Enabled Apache rewrite module
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. apps.twexxt.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://apps.twexxt.com/.well-known/acme-challenge/ZmikhkFUoDiZDZCmaC-QnuhJT-mBcFm57sGIh87XzLs: “Apache Tomcat/7.0.52 (Ubuntu) - Error report<!–H1 {font-family:Tahoma,Arial,sans-serif;color:”
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
My web server is (include version): Tomcat 7.0.52
The operating system my web server runs on is (include version): Ubuntu 14.04 (trusty)
My hosting provider, if applicable, is: aws
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): 0.28.0
I am still getting the same error.
The output was:
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for apps.twexxt.com
Using the webroot path /var/lib/tomcat7/webapps for all unmatched
domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. apps.twexxt.com (http-01):
urn:ietf:params:acme:error:unauthorized :: The client lacks
sufficient authorization :: Invalid response from
:
"Apache Tomcat/7.0.52 (Ubuntu)
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly. #ServerNamewww.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
JkMount /* worker1
Thank you, Juergen.
Using the actual root path for tomcat worked:
sudo certbot run -a webroot -i apache -w /var/lib/tomcat7/webapps/ROOT/ -d apps.twexxt.com