Use Windows system certificate store if requested by system properties#911
Open
lwahonen wants to merge 1 commit intoeclipse-ee4j:masterfrom
Open
Use Windows system certificate store if requested by system properties#911lwahonen wants to merge 1 commit intoeclipse-ee4j:masterfrom
lwahonen wants to merge 1 commit intoeclipse-ee4j:masterfrom
Conversation
jansupol
reviewed
Oct 2, 2024
| TrustManagerFactory trustManagerFactory = null; | ||
| KeyManagerFactory keyManagerFactory = null; | ||
|
|
||
| if ("SunMSCAPI".equals(System.getProperty(TRUST_STORE_PROVIDER))) { |
Contributor
There was a problem hiding this comment.
@lwahonen Can instead of this code block be just updated the row below:
if (trustStoreBytes != null || trustStoreFile != null) {
with if (trustStoreBytes != null || trustStoreFile != null || "SunMSCAPI".equals(trustStoreType)) { ?
dmatej
reviewed
Jan 16, 2026
| keyStore.load(null, null); | ||
| trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); | ||
| trustManagerFactory.init(keyStore); | ||
| } catch (Throwable e) { |
There was a problem hiding this comment.
Catching Throwable is a bad practice. GeneralSecurityException would be better. Same on the other place.
However looking at the already existing code, which is swallowing exceptions, we should probably revisit these classes.
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.
Not sure if this is the most elegant way to handle this, but if the user has selected SunMSCAPI as the trust store provider, they probably expect Tyrus to load Windows system certificate store (=work with enterprise root signed ssl certificates)