Package org.apache.catalina.core
Class OpenSSLLifecycleListener
- java.lang.Object
-
- org.apache.catalina.core.OpenSSLLifecycleListener
-
- All Implemented Interfaces:
LifecycleListener
public class OpenSSLLifecycleListener extends java.lang.Object implements LifecycleListener
Implementation ofLifecycleListenerthat 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
Fields Modifier and Type Field Description protected static java.lang.ObjectlockLock object for OpenSSL initialization.protected static StringManagersmThe string manager for this package.
-
Constructor Summary
Constructors Constructor Description OpenSSLLifecycleListener()Constructs an OpenSSLLifecycleListener.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFIPSMode()Returns the FIPS mode status.static java.lang.StringgetInstalledOpenSslVersion()Get the installed OpenSSL version string (via FFM), if available.java.lang.StringgetSSLEngine()Returns the SSL engine information.java.lang.StringgetSSLRandomSeed()Returns the SSL random seed.static booleangetUseOpenSSL()Returns whether OpenSSL should be used.static booleanisAvailable()Checks if OpenSSL is available.booleanisFIPSModeActive()Checks if FIPS mode is active.voidlifecycleEvent(LifecycleEvent event)Primary entry point for startup and shutdown events.voidsetFIPSMode(java.lang.String FIPSMode)Sets the FIPS mode.voidsetSSLEngine(java.lang.String SSLEngine)Sets the SSL engine.voidsetSSLRandomSeed(java.lang.String SSLRandomSeed)Sets the SSL random seed.voidsetUseOpenSSL(boolean useOpenSSL)Sets whether to use OpenSSL.
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The string manager for this package.
-
lock
protected static final java.lang.Object lock
Lock object for OpenSSL initialization.
-
-
Method Detail
-
isAvailable
public static boolean isAvailable()
Checks if OpenSSL is available.- Returns:
- true if OpenSSL is available
-
getInstalledOpenSslVersion
public static java.lang.String 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
public void lifecycleEvent(LifecycleEvent event)
Primary entry point for startup and shutdown events.- Specified by:
lifecycleEventin interfaceLifecycleListener- Parameters:
event- The event that has occurred
-
getSSLEngine
public java.lang.String getSSLEngine()
Returns the SSL engine information.- Returns:
- The SSL engine string, or null if not available
-
setSSLEngine
public void setSSLEngine(java.lang.String SSLEngine)
Sets the SSL engine.- Parameters:
SSLEngine- The SSL engine to use
-
getSSLRandomSeed
public java.lang.String getSSLRandomSeed()
Returns the SSL random seed.- Returns:
- The SSL random seed, or null if not available
-
setSSLRandomSeed
public void setSSLRandomSeed(java.lang.String SSLRandomSeed)
Sets the SSL random seed.- Parameters:
SSLRandomSeed- The SSL random seed
-
getFIPSMode
public java.lang.String getFIPSMode()
Returns the FIPS mode status.- Returns:
- The FIPS mode, or null if not available
-
setFIPSMode
public void setFIPSMode(java.lang.String FIPSMode)
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
-
-