Class TlsConfig
java.lang.Object
com.loomcache.common.config.TlsConfig
Immutable TLS/mTLS configuration for LoomCache nodes and clients.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for TlsConfig with validation. -
Method Summary
Modifier and TypeMethodDescriptionintAccept timeout applied to TLS server sockets (SO_TIMEOUT).static TlsConfig.Builderbuilder()Create a new builder for TlsConfig.intGet the number of days before certificate expiration to emit a critical alert.intGet the number of days before certificate expiration to emit a warning.Get the cipher suites to enable.static TlsConfigdisabled()Disabled TLS singleton for convenience.booleanenabled()Get whether TLS is enabled.Get the keystore password.@Nullable PathGet the keystore path.Get the keystore type.Get the TLS protocols to enable.provider()Get the TLS provider.booleanGet whether client authentication (mTLS) is required.booleanWhether certificate revocation checking (CRL/OCSP) is enabled.booleanWhether revocation checking uses soft-fail mode.toString()Get the truststore password.@Nullable PathGet the truststore path.Get the truststore type.
-
Method Details
-
enabled
public boolean enabled()Get whether TLS is enabled.- Returns:
- true if TLS is enabled
-
keyStorePath
Get the keystore path.- Returns:
- the keystore path, or null if not configured
-
keyStorePassword
-
keyStoreType
-
trustStorePath
Get the truststore path.- Returns:
- the truststore path, or null if not configured
-
trustStorePassword
-
trustStoreType
Get the truststore type.- Returns:
- the truststore type (PKCS12 or JKS)
-
requireClientAuth
public boolean requireClientAuth()Get whether client authentication (mTLS) is required.- Returns:
- true if client auth is required
-
protocols
-
cipherSuites
-
provider
-
certExpirationWarningDays
public int certExpirationWarningDays()Get the number of days before certificate expiration to emit a warning.- Returns:
- warning threshold in days (default 30)
-
certExpirationCriticalDays
public int certExpirationCriticalDays()Get the number of days before certificate expiration to emit a critical alert.- Returns:
- critical threshold in days (default 7)
-
revocationCheckingEnabled
public boolean revocationCheckingEnabled()Whether certificate revocation checking (CRL/OCSP) is enabled. When enabled, the TrustManagerFactory will verify certificates against CRL distribution points and OCSP responders embedded in the certificate.- Returns:
- true if revocation checking is enabled (default false)
-
revocationSoftFail
public boolean revocationSoftFail()Whether revocation checking uses soft-fail mode. When true, CRL/OCSP fetch failures are silently ignored (a revoked cert may be accepted if the CRL server is unreachable). When false, any CRL/OCSP fetch failure causes the handshake to fail (stricter but may cause outages if CRL infrastructure is down).- Returns:
- true for soft-fail (default), false for hard-fail
-
acceptTimeoutMs
public int acceptTimeoutMs()Accept timeout applied to TLS server sockets (SO_TIMEOUT). Controls how often the accept loop wakes up to check for shutdown signals.- Returns:
- accept timeout in milliseconds (default 2000)
-
disabled
Disabled TLS singleton for convenience.- Returns:
- a disabled TLS configuration
-
toString
-
builder
Create a new builder for TlsConfig.- Returns:
- a new Builder instance
-