Caddy: Adding Better PQC, Disabling 256-bit ECC, and Using P-384 Let's Encrypt Certificates

December 4, 2026 · Jonah Aragon

At Triplebit we use a custom build of Caddy to add support for a few plugins not included by default, but it is especially relevant today because we now also include support for secp384r1mlkem1024 and secp256r1mlkem768, neither of which Caddy natively exposes as a configuration option even though it is supported by Go.

Note

The context behind this change is that we believe 256-bit ECC to be unsafe, more details in our transition announcement. This guide deals with our webservers specifically, but may be a useful reference for your own.

There's an open PR for this, so hopefully it's included in the next release, but in the meantime the patch is incredibly simple.

Caddy has instructions on how to use a custom build of Caddy instead of the pre-packaged version on Debian, while retaining the ability to use Debian's systemd and other support files from their package.

After following their dpkg-divert instructions, it is as easy as replacing the custom Caddy file with my latest release.

wget https://github.com/jonaharagon/caddy-build/releases/latest/download/caddy-linux-amd64
chmod +x caddy-linux-amd64
mv caddy-linux-amd64 /usr/bin/caddy.custom
caddy version

Configuring Caddy

Now that we have support for the latest hybrid post-quantum encryption, we need to configure each site to use these new security options, which we can do by adding a snippet in our Caddyfile:

(pqc_tls) {
	tls {
		key_type p384
		protocols tls1.2 tls1.3
		curves secp384r1mlkem1024 secp256r1mlkem768 x25519mlkem768 secp384r1
		issuer acme {
			preferred_chains {
				root_common_name "ISRG Root X2"
			}
			profile shortlived
		}
	}
}

This snippet:

  1. Changes our own private key to P-384 (the default is 256-bit)
  2. Enforces TLS 1.2 and 1.3
  3. Enables secp384r1mlkem1024 secp256r1mlkem768, and disables x25519 and secp256r1 curves
  4. Requests that Let's Encrypt provides a certificate from their X2 root
  5. Configures shortlived certificates, which expire after 6 days.

Tip

For readers following along, you may wish to set profile tlsserver instead of shortlived, which will set your certificate expiration to 45 days instead of 90 days, and implement some other improvements. profile shortlived is the same, except certificates expire after 6 days, so you should be confident your certificate automation is working properly (although with Caddy it likely is). In either case, we would recommend not sticking with the default profile classic setting. More information about request profiles.

As noted in our earlier announcement, we will leave x25519mlkem768 (included in Caddy currently) and secp256r1mlkem768 (included via patch) support enabled despite their use of 256-bit ECC for the classical encryption component, because ML-KEM is already believed to be secure against classical attacks anyway, and x25519mlkem768 in particular has the widest client support. Disabling them would mean some clients would fall back to non-PQC secp384r1.

Tip

If you want to enforce PQC, you can instead set curves secp384r1mlkem1024 secp256r1mlkem768 x25519mlkem768. We plan to evaluate our current traffic to determine when it would be acceptable to make this change on our end.

We use Let's Encrypt's X2 root secured with P-384 keys instead of their X1 root secured with RSA-4096 because while RSA-4096 should be secure, unfortunately the intermediate certificates underneath the X1 root are RSA-2048, which makes X1 unacceptable.

Next, we import this snippet on each website:

triplebit.org {
	import pqc_tls
	...
}

privacyguides.org {
	import pqc_tls
	...
}

Note

By the end of 2026, every service hosted by Triplebit will be behind two identically configured Caddy reverse proxies per datacenter, which share TLS certificates. In Minneapolis, 23.188.56.113 and 23.188.56.114. This will allow us to enable Encrypted Client Hello (ECH) in a future update.

Finally, we check our configuration: caddy validate --config /etc/caddy/Caddyfile and restart: systemctl restart caddy

Testing Our Configuration

We can test our configurations with the following webserver-test.sh script:

#!/bin/bash
for group in X25519MLKEM768 SecP384r1MLKEM1024 P-384 X25519 P-256; do
    echo "Testing $group"
    openssl s_client \
        -connect "$domain:443" \
        -servername "$domain" \
        -tls1_3 \
        -groups "$group" \
        -brief </dev/null
done

When running domain=example.com bash webserver-test.sh (for example) in a terminal, before our changes were applied we would generally see "CONNECTION ESTABLISHED" under four of the five keys, with SecP384r1MLKEM1024 failing to connect.

After the change is applied we will see the connection now establishes with SecP384r1MLKEM1024, and we will no longer see "CONNECTION ESTABLISHED" underneath X25519 and P-256.

To my knowledge, there are no browsers which support X25519 but do not support P-384, so this change should not introduce compatibility issues. For performance reasons, browsers will typically prefer X25519 to P-384 when both are offered, so disabling X25519 explicitly will therefore improve security.

Comments