# Enable post-quantum TLS on Traefik

Source: https://pq-scan.com/fix/traefik-post-quantum-tls
Fixes: pq-kex-missing, pq-kex-supported-not-preferred. Server: Traefik. Effort: 5 min.
Requires: Traefik built with Go 1.24 or newer (3.4+, current 2.11); 3.5+ to name the hybrid in curvePreferences. Lab-tested on Traefik 3.8.0, Go 1.27.4, 2026-12-05 (PQ Scan Docker lab).

Current Traefik prefers the X25519MLKEM768 hybrid by default. Upgrade, and make sure curvePreferences does not leave it out.

## The fix

Run Traefik 3.5 or newer and **don't set `curvePreferences`**. Traefik then uses the Go defaults, which prefer X25519MLKEM768.

If you must keep `curvePreferences`, include the hybrid in it:

```yaml title="dynamic config (file provider)"
tls:
  options:
    default:
      curvePreferences:
        - X25519MLKEM768
        - X25519
        - CurveP256
        - CurveP384
```

The order of the list does not matter. Go ignores it and always prefers the hybrid when it is in the list. In the lab, `[X25519, CurveP256, X25519MLKEM768]` gave the same result as the list above.

**The common pitfall:** a `curvePreferences` list copied from an older guide, such as `[X25519, CurveP256, CurveP384]`, turns post-quantum off. Traefik logs no error for it.

## Check your version first

```sh
traefik version
# Version: 3.8.0 ... Go version: go1.27.4
```

Traefik uses Go's TLS, not OpenSSL. The Go version it was built with decides what it can do.

| Official `traefik` Docker image | Built with | Post-quantum by default | `X25519MLKEM768` in `curvePreferences` |
|---|---|---|---|
| v3.6, v3.7, v3.8 (3.8.0) | Go 1.26.5 to 1.27.4 | Preferred | Accepted |
| v3.5 | Go 1.24.10 | Preferred | Accepted |
| v3.4 | Go 1.24.5 | Preferred | **Rejected: TLS breaks** |
| v2.11 (2.11.64) | Go 1.27.4 | Preferred | **Rejected: TLS breaks** |
| v3.0, v3.2, v3.3 | Go 1.22.4 to 1.23.8 | No X25519MLKEM768 | Not tested |

Checked by running each image against the same probes on 2026-12-06.

On Traefik 3.4 and 2.11, the name is unknown. Traefik logs `invalid CurveID in curvePreferences: X25519MLKEM768`, and in the lab every TLS handshake on that router failed, classical ones too. On those versions, remove `curvePreferences` instead of adding the hybrid to it.

## What the common configs actually do

Tested in Docker (official `traefik:v3` image, Traefik 3.8.0, Go 1.27.4) against five client offers, including the exact one browsers send. "Preferred" means the server asks for post-quantum even when the client led with a classical key share.

| Config | Post-quantum | What browsers get |
|---|---|---|
| No `curvePreferences` (Go default) | Preferred | X25519MLKEM768 |
| `[X25519MLKEM768, X25519, …]` (this fix) | Preferred | X25519MLKEM768 |
| `[X25519, CurveP256, X25519MLKEM768]` (hybrid last) | Preferred | X25519MLKEM768 |
| `[X25519, CurveP256, CurveP384]` (old guides) | Off | X25519 (classical) |

There is no "supported, not preferred" state on current Traefik: if the hybrid is allowed, it is preferred. The only way to lose it is a `curvePreferences` list that leaves it out.

## Verify

```sh
openssl s_client -connect example.com:443 -groups X25519MLKEM768 </dev/null 2>&1 | grep "Negotiated TLS1.3 group"
# Negotiated TLS1.3 group: X25519MLKEM768
```

Or rescan with PQ Scan: the Confidentiality axis should read **PQ preferred**.

## Things that don't change
- Your certificates stay the same, including ACME ones (post-quantum certificates are not available for public websites yet).
- Clients without post-quantum support still connect with X25519 or P-256.
- Routers that use a named TLS option (not `default`) need the same check on that option.
- If a CDN or load balancer terminates TLS in front of Traefik, visitors see the CDN's TLS, not this config. Fix it there too.

Verify after deploying: https://pq-scan.com/r/<your-domain>?fresh=1
