com.firefly.net.tcp.secure.openssl.nativelib.OpenSslEngine Maven / Gradle / Ivy
package com.firefly.net.tcp.secure.openssl.nativelib;
import javax.net.ssl.SSLEngine;
/**
* Implements a {@link SSLEngine} using
* OpenSSL BIO abstractions.
*
* This class will use a finalizer to ensure native resources are automatically cleaned up. To avoid finalizers
* and manually release the native memory see {@link ReferenceCountedOpenSslEngine}.
*/
public final class OpenSslEngine extends ReferenceCountedOpenSslEngine {
OpenSslEngine(OpenSslContext context, String peerHost, int peerPort, boolean jdkCompatibilityMode) {
super(context, peerHost, peerPort, jdkCompatibilityMode);
}
@Override
@SuppressWarnings("FinalizeDeclaration")
protected void finalize() throws Throwable {
super.finalize();
OpenSsl.releaseIfNeeded(this);
}
}