Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client_auth: wire up leaf verifier Caddyfile #6772

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohammed90
Copy link
Member

Closes #6771

@mohammed90 mohammed90 added bug 🐞 Something isn't working in progress 🏃‍♂️ Being actively worked on labels Jan 7, 2025
Comment on lines +949 to +952
if !strings.HasPrefix(modName, "load_") {
return d.Err("expected a leaf certificate loader module name prefixed with `load_`")
}
modName = strings.TrimPrefix(modName, "load_")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@francislavoie, what do you think of this from Caddyfile UX perspective?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need load_ at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I should future-proof it in case other parameters are added besides the loaders. I thought the namespace will be clobbered if I don't distinguish them with a prefix or nest them into a block. I don't know...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module name is already prefixed by tls.leaf_cert_loader.. Are there other "kinds" (?) of modules that go in this namespace that aren't loading?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be like verifier leaf file <filename> etc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm saying what if leaf has more parameters in the future, not the loader modules. Anyways, looking at what VerifyClientCertificate does, I can't imagine any new behavioral parameters that may be added in the future.

The format verifier leaf file <filename> doesn`t work because it blocks the use multiple loaders, which is currently possible. In other words, this is now possible:

verifier leaf {
    file file-1.pem file-2.pem
    file more-cert.pem
    folder /path/to/cert/repo
}

The one-liner disallows this use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working in progress 🏃‍♂️ Being actively worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trusted_leaf_certs functionality after its deprecation in Caddyfile
3 participants