From d01d97d743b5f569761a1f9a865572f4438173d3 Mon Sep 17 00:00:00 2001 From: Reda Chouk Date: Thu, 31 Oct 2024 13:00:41 +0100 Subject: [PATCH] Fix: Replace outdated get1Session with getSession in setResume() Replaced the call to the outdated native get1Session method with getSession, resolving performance issues for TLS 1.3 session resumption. This change reduces the setResume execution time to well under 2 seconds, meeting performance requirements. All tests passed after the update. --- src/java/com/wolfssl/WolfSSLSession.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/java/com/wolfssl/WolfSSLSession.java b/src/java/com/wolfssl/WolfSSLSession.java index 7b6ac273..7dc6662c 100644 --- a/src/java/com/wolfssl/WolfSSLSession.java +++ b/src/java/com/wolfssl/WolfSSLSession.java @@ -256,7 +256,6 @@ private native int read(long ssl, byte[] data, int offset, int sz, private native int getError(long ssl, int ret); private native int setSession(long ssl, long session); private native long getSession(long ssl); - private native long get1Session(long ssl); private static native int wolfsslSessionIsSetup(long ssl); private static native int wolfsslSessionIsResumable(long ssl); private static native long wolfsslSessionDup(long session); @@ -1314,7 +1313,7 @@ public long getSession() throws IllegalStateException { confirmObjectIsActive(); synchronized (sslLock) { - return get1Session(this.sslPtr); + return getSession(this.sslPtr); } }