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;
|
return WolfSSL.SSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected synchronized void clearObjectState() {
|
||||||
|
this.ssl = null;
|
||||||
|
this.session = null;
|
||||||
|
this.params = null;
|
||||||
|
this.authStore = null;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected synchronized void finalize() throws Throwable {
|
protected synchronized void finalize() throws Throwable {
|
||||||
|
|
|
@ -1909,6 +1909,10 @@ public class WolfSSLSocket extends SSLSocket {
|
||||||
this.ssl.freeSSL();
|
this.ssl.freeSSL();
|
||||||
this.ssl = null;
|
this.ssl = null;
|
||||||
|
|
||||||
|
/* Reset internal WolfSSLEngineHelper to null */
|
||||||
|
this.EngineHelper.clearObjectState();
|
||||||
|
this.EngineHelper = null;
|
||||||
|
|
||||||
/* Release Input/OutputStream objects */
|
/* Release Input/OutputStream objects */
|
||||||
if (this.inStream != null) {
|
if (this.inStream != null) {
|
||||||
this.inStream.close();
|
this.inStream.close();
|
||||||
|
@ -2080,6 +2084,8 @@ public class WolfSSLSocket extends SSLSocket {
|
||||||
}
|
}
|
||||||
this.ssl.freeSSL();
|
this.ssl.freeSSL();
|
||||||
this.ssl = null;
|
this.ssl = null;
|
||||||
|
this.EngineHelper = null;
|
||||||
|
this.params = null;
|
||||||
}
|
}
|
||||||
super.finalize();
|
super.finalize();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue