# Class OpenSSLLifecycleListener

java.lang.Object
org.apache.catalina.core.OpenSSLLifecycleListener

All Implemented Interfaces:
  `LifecycleListener`

public class OpenSSLLifecycleListener extends Object implements 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

Fields
Modifier and Type
Field
Description
`protected static final Object`
`lock`
Lock object for OpenSSL initialization.
`protected static final StringManager`
`sm`
The string manager for this package.

## Constructor Summary

Constructors
Constructor
Description
`OpenSSLLifecycleListener()`
Constructs an OpenSSLLifecycleListener.

## Method Summary

Modifier and Type
Method
Description
`String`
`getFIPSMode()`
Returns the FIPS mode status.
`static String`
`getInstalledOpenSslVersion()`
Get the installed OpenSSL version string (via FFM), if available.
`String`
`getSSLEngine()`
Returns the SSL engine information.
`String`
`getSSLRandomSeed()`
Returns the SSL random seed.
`static boolean`
`getUseOpenSSL()`
Returns whether OpenSSL should be used.
`static boolean`
`isAvailable()`
Checks if OpenSSL is available.
`boolean`
`isFIPSModeActive()`
Checks if FIPS mode is active.
`void`
`lifecycleEvent(LifecycleEvent event)`
Primary entry point for startup and shutdown events.
`void`
`setFIPSMode(String FIPSMode)`
Sets the FIPS mode.
`void`
`setSSLEngine(String SSLEngine)`
Sets the SSL engine.
`void`
`setSSLRandomSeed(String SSLRandomSeed)`
Sets the SSL random seed.
`void`
`setUseOpenSSL(boolean useOpenSSL)`
Sets whether to use OpenSSL.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### sm

protected static final StringManager sm
The string manager for this package.

### lock

protected static final Object 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

public static 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:
  `lifecycleEvent` in interface `LifecycleListener`
Parameters:
  `event` - The event that has occurred

### getSSLEngine

public String getSSLEngine()
Returns the SSL engine information.

Returns:
  The SSL engine string, or null if not available

### setSSLEngine

public void setSSLEngine(String SSLEngine)
Sets the SSL engine.

Parameters:
  `SSLEngine` - The SSL engine to use

### getSSLRandomSeed

public String getSSLRandomSeed()
Returns the SSL random seed.

Returns:
  The SSL random seed, or null if not available

### setSSLRandomSeed

public void setSSLRandomSeed(String SSLRandomSeed)
Sets the SSL random seed.

Parameters:
  `SSLRandomSeed` - The SSL random seed

### getFIPSMode

public String getFIPSMode()
Returns the FIPS mode status.

Returns:
  The FIPS mode, or null if not available

### setFIPSMode

public void setFIPSMode(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