caddy icon indicating copy to clipboard operation
caddy copied to clipboard

Providing Trusted Leaf Certificates to the Leaf Certificate Verifier

Open mohammed90 opened this issue 1 year ago • 4 comments

The leaf-certificate verifier in client authentication does not have a way to provide the trusted leaf certificate material without relying no the deprecated field trusted_leaf_certs, which was not meant to be the proxy forever and only left around as a bridge for existing users and not to be used after the introduction of the feature in #4389. At the moment, there's no way to configure the "verifier": "leaf"directly with new behavior only.

We should provide a way to provide the trusted certificates to the tls.client_auth.leaf module.

mohammed90 avatar Jan 17 '24 22:01 mohammed90

@mohammed90 I can take a look at this, unless you want to leave it for someone doing their first contribution.

armadi1809 avatar Jan 17 '24 23:01 armadi1809

Go for it!

mohammed90 avatar Jan 17 '24 23:01 mohammed90

Cool. I have a couple of questions though to make sure I understand this right.

  1. Currently, what happens when we include the { "verifier" : "leaf"} in our config without using the deprecated trusted_leaf_certs field? I am assuming it doesn't do anything?

  2. How do you envision this being implemented? Should it be a sub-directive of the verifier directive?

armadi1809 avatar Jan 18 '24 00:01 armadi1809

  • Currently, what happens when we include the { "verifier" : "leaf"} in our config without using the deprecated trusted_leaf_certs field? I am assuming it doesn't do anything?

Per the code here: https://github.com/caddyserver/caddy/blob/4181c79a8130a59c40c76437e15265452422ccb1/modules/caddytls/connpolicy.go#L561-L567

It'll return an error in the last line

  • How do you envision this being implemented? Should it be a sub-directive of the verifier directive?

Start by figuring out the JSON first, not the Caddyfile. Consider that the source of the certificates can be from various sources, so it should be pluggable.

mohammed90 avatar Jan 18 '24 01:01 mohammed90