JSSE: release WolfSSLEngineHelper state from WolfSSLSocket when SSLSocket.close() is called
parent
a7c1830b0e
commit
65e4191ba4
|
@ -1390,6 +1390,13 @@ public class WolfSSLEngineHelper {
|
|||
return WolfSSL.SSL_FAILURE;
|
||||
}
|
||||
|
||||
protected synchronized void clearObjectState() {
|
||||
this.ssl = null;
|
||||
this.session = null;
|
||||
this.params = null;
|
||||
this.authStore = null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected synchronized void finalize() throws Throwable {
|
||||
|
|
|
@ -1909,6 +1909,10 @@ public class WolfSSLSocket extends SSLSocket {
|
|||
this.ssl.freeSSL();
|
||||
this.ssl = null;
|
||||
|
||||
/* Reset internal WolfSSLEngineHelper to null */
|
||||
this.EngineHelper.clearObjectState();
|
||||
this.EngineHelper = null;
|
||||
|
||||
/* Release Input/OutputStream objects */
|
||||
if (this.inStream != null) {
|
||||
this.inStream.close();
|
||||
|
@ -2080,6 +2084,8 @@ public class WolfSSLSocket extends SSLSocket {
|
|||
}
|
||||
this.ssl.freeSSL();
|
||||
this.ssl = null;
|
||||
this.EngineHelper = null;
|
||||
this.params = null;
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue