state: enable mTLS on the client side - #28
Draft
rlahfa-dinum wants to merge 2 commits into
Draft
Conversation
This should reasonably support (m)TLS on the server side now: - If you set the TLS certificates parameters, TLS is terminated directly on the proxy. - If you set the client CA parameters, client certs are verified and we are in mTLS operations mode. - If you set none, there's no TLS whatsover. In the future, we should allow via settings whether people can still authenticate to the proxy without a client certificate and inject this information into the ACL. I think CRLs should not be supported, let's just have short revocation times, here, problem solved. Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
By using rustls-pkcs11, we can build a PKCS#11 resolver (TPM2/HSM/Yubikey/etc.) to resolve client certificates without specifying URIs. This resolver does not support targeting a precise URI (except if we combine it with special PKCS#11 libraries such as OpenSC). In addition, we do not handle PIN yet, we need a prompt mechanism for that and caching probably. Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
rlahfa-dinum
force-pushed
the
rustls-client
branch
from
February 12, 2026 18:23
f2b311a to
7fba489
Compare
Collaborator
Author
|
For testing here, I think the scenarios should involve:
Here, the tests can only work with a Portail upstream and we should ensure we can do mTLS in the inner tunnel via curl properly to a NGINX target. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #13.
We vendor rustls-pkcs11 (MIT) because it's a single file and has dependencies which we would like to change (
log→tracingorrustls→tokio_rustls).In addition, we probably will modify this dependency to match more our usecases.
Once this is done, we have an out-of-the-box client certificate resolver to pass to rustls.
Some things are not handled: