Skip to content

Commit

Permalink
Address review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMadhushan committed Jan 31, 2025
1 parent b4211d4 commit 9eecd25
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/ballerinalang/command/util/ToolUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public class ToolUtil {
private static final String ENV_TRUSTSTORE_PATH = "BALLERINA_CA_BUNDLE";
private static final String ENV_TRUSTSTORE_PASSWORD = "BALLERINA_CA_PASSWORD";
private static final String ENV_CERT_PATH = "BALLERINA_CA_CERT";
private static final String CA_CERTS_DEFAULT_PATH = System.getProperty("java.home") + "/lib/security/cacerts";
private static final String CA_CERTS_DEFAULT_PASSWORD = "changeit";

private static final String trustStorePath = System.getenv(ENV_TRUSTSTORE_PATH);
private static final String trustStorePassword = System.getenv(ENV_TRUSTSTORE_PASSWORD);
Expand Down Expand Up @@ -143,9 +145,8 @@ public static void setCustomSSLContext() throws IOException {
}
} else {
truststore = KeyStore.getInstance(KeyStore.getDefaultType());
try (InputStream defaultKeys = Files.newInputStream(Paths.get(System.getProperty("java.home") +
"/lib/security/cacerts"))) {
truststore.load(defaultKeys, "changeit".toCharArray()); // Default password for cacerts
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 9eecd25

Please sign in to comment.