From 2c5bf8fe30ce5e337d634e641dae97bbf3647ad5 Mon Sep 17 00:00:00 2001 From: karmst Date: Thu, 2 Jan 2025 07:37:24 -0500 Subject: [PATCH] Fixed issue with SSL Override system keystore setting only if local location and local password are not null --- src/com/belkast/soap/soapProcessor.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/belkast/soap/soapProcessor.java b/src/com/belkast/soap/soapProcessor.java index 8e41876..9e413e4 100644 --- a/src/com/belkast/soap/soapProcessor.java +++ b/src/com/belkast/soap/soapProcessor.java @@ -35,8 +35,11 @@ public class soapProcessor { public static HttpURLConnection getConnection(String thisCredentials, String thisURL, Boolean thisSSL, String thisKeystore, String thisPassword) throws Exception { URL url = new URL(thisURL); - if (thisSSL) + if (thisSSL && thisKeystore != null && thisPassword != null) { + debugProcessor.writer(false, "SSL: " + thisSSL); + debugProcessor.writer(false, "JAVA Keystore: " + thisKeystore); + debugProcessor.writer(false, "JAVA Password: " + thisPassword); System.setProperty("javax.net.ssl.trustStore", thisKeystore); System.setProperty("javax.net.ssl.trustStorePassword", thisPassword); } @@ -45,12 +48,12 @@ public class soapProcessor { URLConnection connection = url.openConnection(); if (thisCredentials != null) { - debugProcessor.writer(false, "We are sending credentials!"); + debugProcessor.writer(false, "We are using credentials!"); connection.setRequestProperty("Authorization", "Basic " + thisCredentials); } else { - debugProcessor.writer(false, "No Credentials will be sent!"); + debugProcessor.writer(false, "No credentials will be used!"); } HttpURLConnection httpConn = (HttpURLConnection)connection; return httpConn;