At Triplebit we use a tradition build of Caddy to add assistance for a few plugins not included by default, but it is particularly applicable today since we now additionally contain assistance for secp384r1mlkem1024 and secp256r1mlkem768, neither of which Caddy natively exposes as a configuration choice equal although it is supported by Go.
Note
The environment rearward this alter is that we accept 256-bit ECC to be unsafe, more particulars in our passage announcement. This guide deals alongside our webservers specifically, but may be a helpful citation 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 tradition build of Caddy alternatively of the pre-packaged type on Debian, during retaining the capability to use Debian's systemd and another assistance records from their package.
After following their dpkg-divert instructions, it is as uncomplicated as replacing the tradition Caddy document alongside 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 assistance for the latest hybrid post-quantum encryption, we need to configure all location to use these new safety 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 highest { preferred_chains { root_common_name "ISRG Root X2" } profile shortlived } } } This snippet:
- Changes our own personal key to P-384 (the default is 256-bit)
- Enforces TLS 1.2 and 1.3
- Enables secp384r1mlkem1024 secp256r1mlkem768, and disables x25519 and secp256r1 curves
- Requests that Let's Encrypt provides a certificate from their X2 root
- Configures shortlived certificates, which expire following 6 days.
Tip
For readers following along, you may desire to set overview tlsserver alternatively of shortlived, which volition set your certificate expiration to 45 days alternatively of 90 days, and execute several another improvements. overview shortlived is the same, apart from certificates expire following 6 days, so you have to be assured your certificate automation is operating correctly (although alongside Caddy it apt is). In either case, we would propose not sticking alongside the default overview traditional setting. More data concerning petition profiles.
As noted in our before announcement, we volition depart x25519mlkem768 (included in Caddy currently) and secp256r1mlkem768 (included via patch) assistance enabled notwithstanding their use of 256-bit ECC for the traditional encryption component, since ML-KEM is already believed to be safe against traditional attacks anyway, and x25519mlkem768 in particular has the widest client support. Disabling them would average several clients would autumn rear to non-PQC secp384r1.
Tip
If you desire to enforce PQC, you can alternatively set curves secp384r1mlkem1024 secp256r1mlkem768 x25519mlkem768. We scheme to measure our current traffic to decide whenever it would be satisfactory to create this alter on our end.
We use Let's Encrypt's X2 base secured alongside P-384 keys alternatively of their X1 base secured alongside RSA-4096 since during RSA-4096 have to be secure, unfortunately the intermediate certificates underneath the X1 base are RSA-2048, which makes X1 unacceptable.
Next, we import this snippet on all website:
triplebit.org { import pqc_tls ... } privacyguides.org { import pqc_tls ... } Note
By the end of 2026, all assistance hosted by Triplebit volition be rearward two identically configured Caddy reverse proxies per datacenter, which portion TLS certificates. In Minneapolis, 23.188.56.113 and 23.188.56.114. This volition authorize us to allow Encrypted Client Hello (ECH) in a forthcoming update.
Finally, we inspect our configuration: caddy validate --config /etc/caddy/Caddyfile and restart: systemctl restart caddy
Testing Our Configuration
We can test our configurations alongside the following webserver-test.sh script:
#!/bin/bash for collection 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 operating domain=example.com attack webserver-test.sh (for example) in a terminal, before our changes were applied we would mostly see "CONNECTION ESTABLISHED" under four of the five keys, alongside SecP384r1MLKEM1024 failing to connect.
After the alter is applied we volition see the association now establishes alongside SecP384r1MLKEM1024, and we volition no longer see "CONNECTION ESTABLISHED" underneath X25519 and P-256.
To my knowledge, there are no browsers which assistance X25519 but do not assistance P-384, so this alter should not current compatibility issues. For achievement reasons, browsers volition typically favor X25519 to P-384 whenever the two are offered, so disabling X25519 explicitly volition hence enhance security.