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 Dec 24, 2024
1 parent 9c05d05 commit ee3728f
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 @@ -357,8 +357,16 @@ else if (osName.contains("Mac")) {
}
}

KeyStore store = KeyStore.getInstance(systemStoreType.orElseGet(KeyStore::getDefaultType));
store.load(null, null);
KeyStore store;
if (systemStoreType.isPresent()) {
store = KeyStore.getInstance(systemStoreType.get());
store.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
store = null;
}
return store;
}

Expand Down

0 comments on commit ee3728f

Please sign in to comment.