#8065·caddy

Expose the negotiated TLS key exchange (curve) as a placeholder and access-log field

Author: SPH00123Created Sep 25, 2026Updated Sep 27, 2026
Labelshelp wanted :sos:feature :gear:

Since Go 1.24, Caddy negotiates hybrid post-quantum key exchange (X25519MLKEM768) by default, and falls back to classical groups for clients that don't support it. That's the right default. But there's currently no way to see which one a given connection got.

Why it matters: a connection that falls back to classical key exchange is exactly what a "harvest now, decrypt later" adversary is waiting for. Operators rolling out post-quantum want to know how much of their traffic is still classical, and from which clients, so they can track it down. Today a classical fallback and a hybrid connection look identical in Caddy's logs.

What's available: Go 1.25 added tls.ConnectionState.CurveID, the key exchange mechanism the connection actually negotiated. Caddy already exposes the neighbouring fields ({http.request.tls.version}, {http.request.tls.cipher_suite}, {http.request.tls.ech}, and version / cipher_suite / ech in the access log's tls object), but not this one.

Proposal:

  • A placeholder {http.request.tls.curve} returning the name, e.g. X25519MLKEM768 (empty when no key exchange was performed).
  • A curve field in the access log's tls object, numeric like the existing version and cipher_suite fields (4588 for X25519MLKEM768, 29 for X25519, 23 for P-256).

curve matches the existing curves option in the tls directive. key_exchange or group would also work if you prefer the TLS 1.3 terminology.

I have a small change ready (placeholder, log field, docs line, tests, about 12 lines of code) and am happy to open a PR if this sounds good.

Assistance disclosure: I used Claude (Anthropic) to help draft this issue and the proposed change.