Skip to content

Commit 4db73ba

Browse files
committed
make WolfSSL object a static class variable in WolfSSLProvider
1 parent 42b86b6 commit 4db73ba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/java/com/wolfssl/provider/jsse/WolfSSLProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
*/
3535
public final class WolfSSLProvider extends Provider {
3636

37+
/* Keep one static reference to native wolfSSL library across
38+
* all WolfSSLProvider objects. */
39+
private static WolfSSL sslLib = null;
40+
3741
public class JSSEFIPSErrorCallback implements WolfSSLFIPSErrorCallback {
3842
public void errorCallback(int ok, int err, String hash) {
3943
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
@@ -75,7 +79,7 @@ public WolfSSLProvider() {
7579

7680
try {
7781
/* initialize native wolfSSL */
78-
WolfSSL sslLib = new WolfSSL();
82+
sslLib = new WolfSSL();
7983
} catch (WolfSSLException e) {
8084
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
8185
"Failed to initialize native wolfSSL library");

0 commit comments

Comments
 (0)