Unable renewing certificate

Hi. I'm unable renewing certificate. Might help me ?
My domain is: https://decidim.ovh runs properly

I ran this command: sudo certbot renew

It produced this output:
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: decidim.ovh
Type: connection
Detail: 90.9.0.72: Fetching https://decidim.ovh/.well-known/acme-challenge/rKyoe2gkqkYKcYBb_riD0aQEKFGV8Cxa-aPqtGLaWq8: Timeout during connect (likely firewall problem)

Domain: www.decidim.ovh
Type: connection
Detail: 90.9.0.72: Fetching https://decidim.ovh/.well-known/acme-challenge/2-PB620-S-WPnobGn7-VA60m4nvGCmIpt8GTCprsKMA: Timeout during connect (likely firewall problem)

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.

My web server is (include version): Server version: Apache/2.4.52 (Ubuntu)
Server built: 2024-01-17T03:00:18

The operating system my web server runs on is (include version): ubuntu 22.04

My hosting provider, if applicable, is: localhost

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): filezila

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

I received this message : Your certificate (or certificates) for the names listed below will expire in 19 days (on 2024-04-27)

/etc/apache2/ports.conf
Listen 80

Listen 443


Listen 443

decidim.ovh.com
<VirtualHost *:80>
ServerName decidim.ovh
ServerAlias www.decidim.ovh
# Redirection 301 vers le site en HTTPS
Redirect permanent / https://decidim.ovh/

<VirtualHost *:443>
ServerName decidim.ovh
ServerAlias www.decidim.ovh
DocumentRoot "/var/www/nextcloud/"
<Directory "/var/www/nextcloud/">
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted

# directives obligatoires pour TLS
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www.decidim.ovh/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.decidim.ovh/privkey.pem
Header always set Strict-Transport-Security "max-age=15768000"
ErrorLog /var/log/apache2/error.decidim.ovh.log
CustomLog /var/log/apache2/access.decidim.ovh.log combined

access.decidim.ovh.log
"GET /.well-known/acme-challenge/QecDsWZkeceqtLtqNwYLKx-4EDeZqk8a1Y3ICp0IAKo: HTTP/1.1" 404

I believe your IPv6 address is not correct. Let's Encrypt favors that when you have an AAAA record in your DNS. Connections on that timeout. And, because you redirect HTTP to HTTPS the cert request fails due to LE failing the IPv4 retry. See below topic for details.

But, just make sure your IPv6 address is correct in your AAAA record

nslookup decidim.ovh
A    Address: 90.9.0.72
AAAA Address: 2a01:cb15:8455:d400:20f:b0ff:fece:da23

You could run this command to check your public IPv6 address

curl -6 https://ifconfig.io
3 Likes

Hi
The problem is that as soon as I change the AAAA parameter with the right IPV6, the IPV6 change immediately, so that when I run sudo certbot renew, IPV6 is wrong again.

Is your server getting their IPv6 address by SLAAC and is using privacy extensions by any chance?

For a server you probably want to configure your IPv6 in such a way you that you have a fixed IPv6 address. Whether that's using a static IPv6 address or using SLAAC but with the address based on the interface identifier, that doesn't matter that much. But a continuously changing address would be very cumbersome.

3 Likes

If you have IPv6 privacy extensions enabled, you need to use the management address. If you have command line access you can identity the correct address using the following: ip -6 addr show and looking for the address with the mngtmpaddr flag.

3 Likes

The what now? My laptop using NetworkManager does not have that flag. My server however does. So it seems a YMMV thing.

1 Like

I copied that flag from a laptop that uses NetworkManager. :man_shrugging:

2 Likes

Oh, weird.. Then I don't know why I don't see it on this laptop :stuck_out_tongue:

1 Like

We may need to start a new topic in the Lounge to investigate further. :grin:

4 Likes

Hi. Still does'nt work. Here are the results
<ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
5: wlxc8d3a3f440cf: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2a01:cb15:8455:d400:74f:14ac:2b06:e2b2/64 scope global temporary dynamic
valid_lft 86380sec preferred_lft 580sec
inet6 2a01:cb15:8455:d400:7ae8:e62e:1f98:be9f/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86380sec preferred_lft 580sec
inet6 fe80::fc0a:23e0:84c1:5414/64 scope link noprefixroute
valid_lft forever preferred_lft forever/>

<nslookup decidim.ovh
Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: decidim.ovh
Address: 90.9.0.72
Name: decidim.ovh
Address: 2a01:cb15:8455:d400:7ae8:e62e:1f98:be9f/>

sudo certbot renew
<Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: decidim.ovh
Type: connection
Detail: 90.9.0.72: Fetching https://decidim.ovh/.well-known/acme-challenge/eRYcaeKR79uvmeBz5r4hvKPYsnEHbXj0mOlgXGSuKZc: Timeout during connect (likely firewall problem)/>

<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./>

Are you able to remove the AAAA from your DNS. Then Let's Encrypt will just use the IPv4 address.

Once that is proven you can work on sorting out the problems with IPv6.

If your DNS AAAA record does not match your IPv6 public IP that will affect anyone trying to use IPv6 to reach you. Not just Let's Encrypt

3 Likes

That [IPv4] path seems to have its' own problem:

1 Like

Not necessarily. That is the bug that shows the IPv4 address even when it was the IPv6 retry that failed. Note the HTTPS in the error message

I am not at a computer where I could poke that directly to see.

Osiris reported it formally After recurring here

2 Likes

That appears to be the correct address. It does not respond on port 80 or port 443.

It sounds like you may have a firewall issue or routing problem in your OVH infrastructure.

3 Likes

Hi Firewall has always been inactive
sudo ufw status
État : inactif

all renewals succeeded

What changed?

2 Likes

Hi
getting rid of IPV6's adresses in DNS records fixed the problem
Thank's to all of you

2 Likes