Class OpenSSLLifecycleListener
java.lang.Object
org.apache.catalina.core.OpenSSLLifecycleListener
- All Implemented Interfaces:
LifecycleListener
Implementation of
LifecycleListener that will do the global initialization of OpenSSL according to
specified configuration parameters. Using the listener is completely optional, but is needed for configuration and
full cleanup of a few native memory allocations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ObjectLock object for OpenSSL initialization.protected static final StringManagerThe string manager for this package. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the FIPS mode status.static StringGet the installed OpenSSL version string (via FFM), if available.Returns the SSL engine information.Returns the SSL random seed.static booleanReturns whether OpenSSL should be used.static booleanChecks if OpenSSL is available.booleanChecks if FIPS mode is active.voidlifecycleEvent(LifecycleEvent event) Primary entry point for startup and shutdown events.voidsetFIPSMode(String FIPSMode) Sets the FIPS mode.voidsetSSLEngine(String SSLEngine) Sets the SSL engine.voidsetSSLRandomSeed(String SSLRandomSeed) Sets the SSL random seed.voidsetUseOpenSSL(boolean useOpenSSL) Sets whether to use OpenSSL.
-
Field Details
-
sm
The string manager for this package. -
lock
Lock object for OpenSSL initialization.
-
-
Constructor Details
-
OpenSSLLifecycleListener
public OpenSSLLifecycleListener()Constructs an OpenSSLLifecycleListener.
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Checks if OpenSSL is available.- Returns:
- true if OpenSSL is available
-
getInstalledOpenSslVersion
Get the installed OpenSSL version string (via FFM), if available.- Returns:
- the OpenSSL version string (e.g., "OpenSSL 3.2.6 30 Sep 2025"), or null if not available
-
lifecycleEvent
Primary entry point for startup and shutdown events.- Specified by:
lifecycleEventin interfaceLifecycleListener- Parameters:
event- The event that has occurred
-
getSSLEngine
Returns the SSL engine information.- Returns:
- The SSL engine string, or null if not available
-
setSSLEngine
Sets the SSL engine.- Parameters:
SSLEngine- The SSL engine to use
-
getSSLRandomSeed
Returns the SSL random seed.- Returns:
- The SSL random seed, or null if not available
-
setSSLRandomSeed
Sets the SSL random seed.- Parameters:
SSLRandomSeed- The SSL random seed
-
getFIPSMode
Returns the FIPS mode status.- Returns:
- The FIPS mode, or null if not available
-
setFIPSMode
Sets the FIPS mode.- Parameters:
FIPSMode- The FIPS mode setting
-
isFIPSModeActive
public boolean isFIPSModeActive()Checks if FIPS mode is active.- Returns:
- true if FIPS mode is active
-
setUseOpenSSL
public void setUseOpenSSL(boolean useOpenSSL) Sets whether to use OpenSSL.- Parameters:
useOpenSSL- true to use OpenSSL
-
getUseOpenSSL
public static boolean getUseOpenSSL()Returns whether OpenSSL should be used.- Returns:
- true if OpenSSL should be used
-