Dry run of renewing certificate to comply with email about changes


#1

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: suce.co.uk
www.suce.co.uk

I ran this command: sudo certbot renew --dry-run

It produced this output:[it works fine for the www.suce.co.uk domain, it’s just the suce.co.uk domain it doesn’t like]

Attempting to renew cert (suce.co.uk) from /etc/letsencrypt/renewal/suce.co.uk.conf produced an unexpected error: Failed authorization procedure. suce.co.uk (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://suce.co.uk/.well-known/acme-challenge/49HKq9OoyISssoGp20Jhk_coNLNK_pALylO4BvcOx88: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p". Skipping.
The following certs could not be renewed:
  /etc/letsencrypt/live/suce.co.uk/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

The following certs were successfully renewed:
  /etc/letsencrypt/live/www.suce.co.uk/fullchain.pem (success)

The following certs could not be renewed:
  /etc/letsencrypt/live/suce.co.uk/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: suce.co.uk
   Type:   unauthorized
   Detail: Invalid response from
   http://suce.co.uk/.well-known/acme-challenge/49HKq9OoyISssoGp20Jhk_coNLNK_pALylO4BvcOx88:
   "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>404 Not
   Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"

   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): Apache 2.4.7

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

My hosting provider, if applicable, is: Linode

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

I’ve had a look at the DNS entries and they seem to point to suce.co.uk rather than www.suce.co.uk, so I’m a bit confused as to why that one works and the other doesn’t.


#2

Hi @ChrisBeeley

you have ipv4 and ipv6 addresses:

Host T IP-Address is auth. ∑ Queries ∑ Timeout
suce.co.uk A 109.74.194.173 yes 1 0
AAAA 2a01:7e00::f03c:91ff:fe3b:13d yes
www.suce.co.uk A 109.74.194.173 yes 1 0
AAAA 2a01:7e00::f03c:91ff:fe3b:13d yes

But your ipv6 isn’t configured, so there are a lot of timeouts:

Domainname Http-Status redirect Sec. G
http://www.suce.co.uk/
109.74.194.173 301 https://www.suce.co.uk/ 0.040 A
http://suce.co.uk/
109.74.194.173 200 0.047 H
http://suce.co.uk/
2a01:7e00::f03c:91ff:fe3b:13d -14 10.026 T
Timeout - The operation has timed out
http://www.suce.co.uk/
2a01:7e00::f03c:91ff:fe3b:13d -14 10.024 T
Timeout - The operation has timed out
https://suce.co.uk/
109.74.194.173 302 https://suce.co.uk/ 1.587 L
Certificate error: RemoteCertificateNameMismatch
https://www.suce.co.uk/
109.74.194.173 302 https://suce.co.uk/ 1.323 B
https://suce.co.uk/
2a01:7e00::f03c:91ff:fe3b:13d -14 10.026 T
Timeout - The operation has timed out
https://www.suce.co.uk/
2a01:7e00::f03c:91ff:fe3b:13d -14 10.027 T
Timeout - The operation has timed out
http://www.suce.co.uk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
109.74.194.173 301 https://www.suce.co.uk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de 0.040 A
http://suce.co.uk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
109.74.194.173 404 0.044 A
Not Found
http://suce.co.uk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
2a01:7e00::f03c:91ff:fe3b:13d -14 10.027 T
Timeout - The operation has timed out
http://www.suce.co.uk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
2a01:7e00::f03c:91ff:fe3b:13d -14 10.024 T
Timeout - The operation has timed out
https://www.suce.co.uk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de -14 10.027 T
Timeout - The operation has timed out

ipv4 + http + non-www isn’t redirected, there is the expected http status 404.

The http + www-version has a redirect to https + www, then it ends in an ipv6 - timeout.

And you have a direct loop https://suce.co.uk/ redirects to the same address.

So perhaps first step: Remove your ipv6 address and the wrong redirect.


#3

What was the rest of Certbot’s output?

What do /etc/letsencrypt/renewal/suce.co.uk.conf and /etc/letsencrypt/renewal/www.suce.co.uk.conf contain?


#4

suce.co.uk is:

renew_before_expiry = 30 days

version = 0.26.1
archive_dir = /etc/letsencrypt/archive/suce.co.uk
cert = /etc/letsencrypt/live/suce.co.uk/cert.pem
privkey = /etc/letsencrypt/live/suce.co.uk/privkey.pem
chain = /etc/letsencrypt/live/suce.co.uk/chain.pem
fullchain = /etc/letsencrypt/live/suce.co.uk/fullchain.pem

Options used in the renewal process

[renewalparams]
authenticator = apache
installer = apache
account = [I removed this in case it’s supposed to be secret?]
server = https://acme-v02.api.letsencrypt.org/directory

www.suce.co.uk says

renew_before_expiry = 30 days

version = 0.28.0
archive_dir = /etc/letsencrypt/archive/www.suce.co.uk
cert = /etc/letsencrypt/live/www.suce.co.uk/cert.pem
privkey = /etc/letsencrypt/live/www.suce.co.uk/privkey.pem
chain = /etc/letsencrypt/live/www.suce.co.uk/chain.pem
fullchain = /etc/letsencrypt/live/www.suce.co.uk/fullchain.pem

Options used in the renewal process

[renewalparams]
server = https://acme-v02.api.letsencrypt.org/directory
installer = apache
authenticator = apache
account = [again I removed this]


#5

Thanks for this. I’ll do as you suggest and try again


#6

Can you show the two vhost configs for port 80?


#7

Here’s one

<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.
    #ServerName www.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
RewriteEngine on
RewriteCond %{SERVER_NAME} =s
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I can only find one, I’m not sure where the other one might be


#8

There is no “ServerName” in that config.
You many need to point certbot to the right --webroot

First try to find the correct --webroot :
If that config is the one being used, then it would be:
DocumentRoot /var/www/html

You can test that out with:
sudo mkdir /var/www/html/.well-known
sudo mkdir /var/www/html/.well-known/acme-challenge
sudo bash -c ‘echo “testing” > /var/www/html/.well-known/acme-challenge/1234’
or if that fails:
Use an editor [vi | nano] on: `/var/www/html/.well-known/acme-challenge/1234’
[and just insert “testing” and save]

Once you can place the 1234 file there, try to access it from the Internet:
http://suce.co.uk/.well-known/acme-challenge/1234
http://www.suce.co.uk/.well-known/acme-challenge/1234
If that works, you have found the right --webroot, otherwise that is not the root folder for those names.
And you can repeat the process through all the “Document Roots” until you find the right one.
This might list them all out for you:
grep -Eri 'DocumentRoot' /etc/apache2