Skip to content

Commit

Permalink
Address review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMadhushan committed Feb 7, 2025
1 parent 276c5e3 commit b902a13
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/ballerinalang/command/util/ToolUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@ public static String getCurrentBallerinaVersion() {
public static void setCustomSSLContext() throws IOException {
// Load custom truststore if provided, otherwise use the default truststore
try {
KeyStore truststore;
KeyStore truststore = KeyStore.getInstance(KeyStore.getDefaultType());
if (trustStorePath != null && trustStorePassword != null) {
truststore = KeyStore.getInstance(KeyStore.getDefaultType());
try (InputStream keys = Files.newInputStream(Paths.get(trustStorePath))) {
truststore.load(keys, trustStorePassword.toCharArray());
}
} else {
truststore = KeyStore.getInstance(KeyStore.getDefaultType());
try (InputStream defaultKeys = Files.newInputStream(Paths.get(CA_CERTS_DEFAULT_PATH))) {
truststore.load(defaultKeys, CA_CERTS_DEFAULT_PASSWORD.toCharArray());
}
Expand Down

0 comments on commit b902a13

Please sign in to comment.