# Incident note: Let's Encrypt acme:error:unauthorized: fix

> Incident note: certbot reports urn:ietf:params:acme:error:unauthorized? The HTTP-01 challenge fails, often due to an AAAA record or a redirect. Diagnosis…

Author: Daniele Michelin · Published: 2026-12-02 · Updated: 2026-12-02 · Language: en
Canonical: https://daniele-michelin.com/en/blog/incident-note-acme-unauthorized/

Let's Encrypt could not fetch the challenge file under /.well-known/acme-challenge/ from the right server and therefore refuses to issue the certificate.

## Read the signal

Start with the exact wording of the error and its timestamp in the log. Then narrow down the cause before changing anything.

```
Type: unauthorized Detail: 2001:db8::10: Invalid response from http://beispiel.de/.well-known/acme-challenge/kX3v9...: 404
```

## Narrow down possible causes

- An AAAA record points to an IPv6 address where no vhost or the wrong one answers – Let's Encrypt prefers IPv6.
- DNS still points to the old server (migration, high TTL).
- Rewrite or redirect rules (Nextcloud, WordPress, forced HTTPS to another host) catch the path.
- Wrong `--webroot` path, so the file is not where nginx serves it.

## Check before changing anything

- Check A and AAAA records

```
dig +short A example.com; dig +short AAAA example.com
```

- Test the challenge path over IPv6

```
curl -6 -sI http://example.com/.well-known/acme-challenge/test
```

- Is nginx listening on IPv6 port 80?

```
nginx -T 2>/dev/null | grep -E 'listen .*\[::\]:80'
```

- Test issuance without hitting rate limits

```
certbot certonly --dry-run --webroot -w /var/www/letsencrypt -d example.com
```

## Fix and test again

- Add `listen [::]:80;` to the HTTP vhost, or delete a wrong AAAA record.
- Serve the challenge path before any redirect: `location ^~ /.well-known/acme-challenge/ { root /var/www/letsencrypt; }`.
- Lower the TTL before a migration and request the certificate only after the switch.
- If port 80 is not reachable, switch to the DNS-01 challenge (e.g. a certbot DNS plugin).
Then repeat the original action and compare the result with the initial error.

## Keep a note for the next ticket

Record the exact error, the check result, the change and the retest. That gives the team a useful starting point next time.

## Why does it work in my browser but not for Let's Encrypt?
Your browser may use IPv4 or a cache. Let's Encrypt queries over IPv6 as soon as an AAAA record exists, and validates from several locations.

[Full error guide: Let's Encrypt: urn:ietf:params:acme:error:unauthorized](https://daniele-michelin.com/en/errors/letsencrypt-acme-error-unauthorized/)
