From 668eb2c9348455c46b4abbb53b45b73cdf8b0395 Mon Sep 17 00:00:00 2001 From: arshardh Date: Tue, 7 May 2024 16:43:24 +0530 Subject: [PATCH] Use system property to get SSL algorithm --- .../org/wso2/carbon/websocket/transport/utils/SSLUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/carbon-transports/websocket/org.wso2.carbon.websocket.transport/src/main/java/org/wso2/carbon/websocket/transport/utils/SSLUtil.java b/components/carbon-transports/websocket/org.wso2.carbon.websocket.transport/src/main/java/org/wso2/carbon/websocket/transport/utils/SSLUtil.java index a2d4a5d882f..d94f2dfc015 100644 --- a/components/carbon-transports/websocket/org.wso2.carbon.websocket.transport/src/main/java/org/wso2/carbon/websocket/transport/utils/SSLUtil.java +++ b/components/carbon-transports/websocket/org.wso2.carbon.websocket.transport/src/main/java/org/wso2/carbon/websocket/transport/utils/SSLUtil.java @@ -53,7 +53,7 @@ public static SSLContext createServerSSLContext(final String keyStoreLocation, KeyStore keyStore = KeyStore.getInstance(KEY_STORE_TYPE); keyStore.load(new FileInputStream(keyStoreLocation), keyStorePwd.toCharArray()); KeyManagerFactory keyManagerFactory = - KeyManagerFactory.getInstance(KEY_MANAGER_TYPE); + KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); keyManagerFactory.init(keyStore, keyStorePwd.toCharArray()); serverSSLCtx = SSLContext.getInstance(PROTOCOL); serverSSLCtx.init(keyManagerFactory.getKeyManagers(), null, null); @@ -85,7 +85,7 @@ public static SSLContext createClientSSLContext(final String trustStoreLocation, trustStore.load(new FileInputStream(trustStoreLocation), trustStorePwd.toCharArray()); TrustManagerFactory trustManagerFactory = - TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE); + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(trustStore); clientSSLCtx = SSLContext.getInstance(PROTOCOL); clientSSLCtx.init(null, trustManagerFactory.getTrustManagers(), null); @@ -116,7 +116,7 @@ public static TrustManagerFactory createTrustmanager(final String trustStoreLoca KeyStore trustStore = KeyStore.getInstance(TRUST_STORE_TYPE); trustStore.load(new FileInputStream(trustStoreLocation), trustStorePwd.toCharArray()); - trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE); + trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(trustStore); // clientSSLCtx = SSLContext.getInstance(PROTOCOL); // clientSSLCtx.init(null,