-
Notifications
You must be signed in to change notification settings - Fork 193
Add java truststore support to additional certificates #1996
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
base: main
Are you sure you want to change the base?
Add java truststore support to additional certificates #1996
Conversation
Much like appending to ca-certificates.crt, this adds support for adding additional certificates to JKS files so that Java can use the additional certificates as well. The behavior is the same in that only existing truststore files will be appended to and the process is otherwise skipped entirely.
fe8cd8b to
be45c5a
Compare
konradzapalowicz
left a comment
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.
I like the code, it plugs nicely into the existing implementation. I've left feedback related to understanding how the corner cases are expected to be handled where I felt I needed additional clarity. Thanks for coding it ⭐
| } | ||
|
|
||
| // Default password for Java cacerts truststore. | ||
| javaTruststorePassword = []byte("changeit") |
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.
should it be changed now and if not then could you expand the docs and write when
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.
This is the default truststore password, it's not a prompt to change it in the future.
| } | ||
|
|
||
| // Write all modified Java truststores back to disk. | ||
| for _, ts := range existingTruststores { |
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.
it feels that this could be a private func, wouldn't testing benefit from that?
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.
I don't see testing benefiting from that tbh. I've only externalized loadJavaTruststores for scoping reasons.
Much like appending to ca-certificates.crt, this adds support for adding additional certificates to JKS files so that Java can use the additional certificates as well. The behavior is the same in that only existing truststore files will be appended to and the process is otherwise skipped entirely.