You can do it in the JSON format of the config, but it’s not something that’s exposed in the Caddyfile. See match and client_authentication parts in the structure.
Start by running caddy adapt -p against a Caddyfile like this:
Is this intentionally not exposed in Caddyfile, or just something lacking feature parity? The Caddyfile matchers feel a bit underpowered/underutilized at the moment, but I do like the function syntax, converting the Caddyfile function imports into the JSON format results in a lot of duplication.