Skip to content

Conversation

graalvmbot
Copy link
Collaborator

Adds support for allowing the user to specify a new default certificate file during runtime.

*/
RuntimeClassInitialization.initializeAtBuildTime(sun.security.util.UntrustedCertificates.class);
RuntimeClassInitialization.initializeAtBuildTime(org.jcp.xml.dsig.internal.dom.XMLDSigRI.class);
Copy link
Member

Choose a reason for hiding this comment

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

This class queries "java.specification.version", but it's not strictly necessary to have it explicitly initialized at buildtime. Your call on whether to keep it here or not

@matthyx
Copy link

matthyx commented Aug 6, 2021

Looks good to me, however you should be careful to not confuse users by saying certificate file when you mean trustStore used to validate third party certificates.
Because they might think you're talking about a keystore used for https endpoints (which is already possible to load at runtime - I think).

when a new certificate file is specified at runtime via setting the
"javax.net.ssl.trustStore\*" system properties, the new certificates will still
be checked against the <java.home>/lib/security/blacklisted.certs loaded at
image buildtime.
Copy link
Member

Choose a reason for hiding this comment

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

Hello @teshull, I was wondering if this blacklisted certificates that are used to decide trust, should be additive. What I mean is, should users be able to specify additional certificates dynamically during runtime usage of the generated native application? If they are not allowed to do so, then a native application/image generated with a specific build time JDK will have to be regularly rebuilt, whenever any new blacklisted certs are added into the JDK itself, which may not always be feasible. I can understand why it would be a bad thing to completely override this blacklisted certificates file at runtime but "adding" new certificates perhaps should be possible? Of course, I haven't looked at the technical implementation aspects of this to know if this is feasible.

Copy link
Member

Choose a reason for hiding this comment

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

Hi @jaikiran, I think it is best to leave this as is and not allow the user to add additional blacklisted certificates. In OpenJDK, it is not possible for the user to specify the blacklist, so adding support for this to me seems like an unneeded deviation from OpenJDK.

Too, now that they can modify the truststore at runtime, that should be sufficient for updating certificate info without a rebuild

@jaikiran
Copy link
Member

I agree with @matthyx, the documentation in this PR refers "certificates" and "keystores", when actually we are dealing with the "truststore". I think consistently using "truststore" in this documentation will avoid any confusion.

@graalvmbot graalvmbot force-pushed the github/tshull/GR-32212_truststoremanager branch from b32df02 to 32fcac3 Compare August 23, 2021 15:27
@graalvmbot graalvmbot merged commit e98ae39 into master Aug 24, 2021
@matthyx
Copy link

matthyx commented Aug 24, 2021

Thanks for your work @teshull ! I'm really looking forward to testing this :)

@graalvmbot graalvmbot deleted the github/tshull/GR-32212_truststoremanager branch February 8, 2022 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants