Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,17 @@ public SSLContext createSSLContext() {
TrustManagerFactory trustManagerFactory = null;
KeyManagerFactory keyManagerFactory = null;

if ("SunMSCAPI".equals(System.getProperty(TRUST_STORE_PROVIDER))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@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)) { ?

try {
KeyStore keyStore = KeyStore.getInstance(System.getProperty(TRUST_STORE_TYPE), "SunMSCAPI");
keyStore.load(null, null);
trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
} catch (Throwable e) {
throw new RuntimeException(e);
}
}

if (keyStoreBytes != null || keyStoreFile != null) {
try {
KeyStore keyStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,17 @@ public SSLContext createSSLContext() {

try {
TrustManagerFactory trustManagerFactory = null;
if ("SunMSCAPI".equals(System.getProperty(TRUST_STORE_PROVIDER))) {
try {
KeyStore keyStore = KeyStore.getInstance(System.getProperty(TRUST_STORE_TYPE), "SunMSCAPI");
keyStore.load(null, null);
trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
} catch (Throwable e) {
throw new RuntimeException(e);
}
}

KeyManagerFactory keyManagerFactory = null;

if (keyStoreBytes != null || keyStoreFile != null) {
Expand Down