-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add CA Search functionality for the windows cert store #5115
Conversation
Signed-off-by: Colin Sullivan <colin@luxantsolutions.com>
I made a few assumptions, happy to make changes if we want to only include the first discovered matching cert, etc. EDIT (2/26/24): After thinking a bit more about this over the weekend, I'm wondering if we always stop at the first match, going from Trusted Root -> Third Party -> Intermediates vs continuing to add from all three as the PR is now. wdyt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surface level pass on functionality (which looks good!) and a few basic comments.
Not for this PR, but I think we need to carve out Windows-specific tests in a GitHub Action job.
Co-authored-by: Byron Ruth <byron@nats.io>
Signed-off-by: Colin Sullivan <colin@luxantsolutions.com>
My suggestion for this one is for @derekcollison to do a review. Once its approved and merged, we can include in a preview.2 release of 2.11 for folks to test. |
I doubt I am the right person to do this review. |
feature wise this seems fine to me - pity about the breaking API change but for this partcular code I dont think its a problem. |
Agree with @ripienaar. @derekcollison Then let's approve and merge once green, cut a new preview shortly, and then iterate based on feedback. |
The failure appears to be some change in CLI arguments for MQTT testing. I don't see it necessary to rebase for that test to pass, so approve and merge when ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ColinSullivan1 I am not seeing here a test that shows a client loading CA from certstore can connect to a server thats same - we do have these nats-server/server/certstore_windows_test.go Line 227 in 6e768e8
I am having some trouble getting this scenario going, so a test showing its possible would be great! |
To make it work I think we need to add here
But I am not sure if thats the right thing to do? I can also do it on my side basically swap those 2 for client purposes? |
So for me to use it in a client without modifying the server, it would be:
I am not sure whats the right thing to do though |
Seems we do this already in the server here: Lines 1398 to 1400 in f1cd3ed
So I am ok doing that unless you have other oppionions @ColinSullivan1 |
Works for me... |
Thanks R.I. - I'll take a look. The CAs added to the certstore were generated from the same CA the client should be using, but I understand we want to future-proof the tests. I'll aim for today, or if not later next week. |
Per our slack convo I'll hold off on this. lmk if there are any other updates/changes - happy to make them. |
This PR adds a new field for searching the windows Certificate Store for CA certificates.
When specifying a value in the
ca_certs_match
field, the following locations are searched:Based on user input, the first matching certificate from subject in the list, from each location, is added to the certificate pool. If no certificates can be found an error is reported.
Example usage:
Additional Notes:
Test scripts have been added to add and remove the test CA certificate, and existing windows certificates have been updated as they were expired.
Signed-off-by: Colin Sullivan colin@luxantsolutions.com