Skip to content

Commit

Permalink
Load default Java truststore for --use-system-truststore
Browse files Browse the repository at this point in the history
  • Loading branch information
oneonestar committed Oct 11, 2023
1 parent 8c67edf commit 25f89e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/trino-client/src/main/java/io/trino/client/OkHttpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,16 @@ else if (osName.contains("Mac")) {
}
}

KeyStore trustStore = KeyStore.getInstance(systemTrustStoreType.orElseGet(KeyStore::getDefaultType));
trustStore.load(null, null);
KeyStore trustStore;
if (systemTrustStoreType.isPresent()) {
trustStore = KeyStore.getInstance(systemTrustStoreType.orElseGet(KeyStore::getDefaultType));
trustStore.load(null, null);
}
else {
// return null if trustStoreType isn't specified and osName is unknown
// trustManagerFactory.init(null) will try to load the default Java trustStore
trustStore = null;
}
return trustStore;
}

Expand Down

0 comments on commit 25f89e7

Please sign in to comment.