From ab159d4108a00fae5a7c45a98d7f533f2472d8ee Mon Sep 17 00:00:00 2001 From: Sage Stefonic Date: Thu, 27 Jun 2024 11:12:06 -0700 Subject: [PATCH] remove check socket closed check --- .../com/wolfssl/provider/jsse/WolfSSLSocket.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java b/src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java index 0692eda7..c2b1a001 100644 --- a/src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java +++ b/src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java @@ -1299,15 +1299,13 @@ public synchronized SSLSession getSession() { "Handshake attempt failed in SSLSocket.getSession()"); /* close SSLSocket */ - if (this.socket != null && !this.socket.isClosed()) { - try { - close(); - } catch (Exception ex) { - WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO, - "close attempt failed in SSLSocket.getSession(): " + - ex); - } + try { + close(); + } catch (Exception ex) { + WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO, + "close attempt failed in SSLSocket.getSession(): " + ex); } + /* return invalid session object with cipher suite * "SSL_NULL_WITH_NULL_NULL" */ return new WolfSSLImplementSSLSession(this.authStore);