diff --git a/src/java/com/wolfssl/WolfSSLDebug.java b/src/java/com/wolfssl/WolfSSLDebug.java index 2945834..b622864 100644 --- a/src/java/com/wolfssl/WolfSSLDebug.java +++ b/src/java/com/wolfssl/WolfSSLDebug.java @@ -548,9 +548,13 @@ public class WolfSSLDebug { } /** - * Check if debug logging is enabled for the specified component + * Check if debug logging is enabled for the specified component. + * + * @param component the component to check (JNI or JSSE) + * + * @return true if debug logging is enabled for the component, */ - private static boolean isDebugEnabled(Component component) { + public static boolean isDebugEnabled(Component component) { if (component == Component.JSSE && DEBUG) { return true; } diff --git a/src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java b/src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java index 38bfa15..482f317 100644 --- a/src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java +++ b/src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java @@ -534,6 +534,11 @@ public class WolfSSLAuthStore { * prints out host:port of all sessions stored in the store. * Called by getSession(). */ private void printSessionStoreStatus() { + + if (!WolfSSLDebug.isDebugEnabled(WolfSSLDebug.Component.JSSE)) { + return; + } + synchronized (storeLock) { Collection values = store.values();