TlsConfig class

TLS configuration for brokers, result backends, and schedule stores.

Populate via TlsConfig.fromEnvironment to consume the standard environment variables:

  • STEM_TLS_CA_CERT – path to the trusted CA bundle (optional)
  • STEM_TLS_CLIENT_CERT / STEM_TLS_CLIENT_KEY – mutual TLS credentials
  • STEM_TLS_ALLOW_INSECURE – if true, bypasses certificate validation

When handshakes fail the caller is expected to surface diagnostics via logTlsHandshakeFailure, which logs the endpoint, TLS metadata, and hints about temporarily enabling insecure mode for debugging.

Constructors

TlsConfig({String? caCertificateFile, String? clientCertificateFile, String? clientKeyFile, bool allowInsecure = false})
Creates a TLS configuration.
const
TlsConfig.disabled()
Disabled TLS configuration (no certificates, no insecure mode).
const
TlsConfig.fromEnvironment(Map<String, String> env)
Builds a TlsConfig from environment variables.
factory

Properties

allowInsecure bool
Whether to allow insecure connections (skip verification).
final
caCertificateFile String?
Path to the trusted CA bundle, if any.
final
clientCertificateFile String?
Path to the client certificate chain, if any.
final
clientKeyFile String?
Path to the client private key, if any.
final
hashCode int
The hash code for this object.
no setterinherited
isEnabled bool
Whether any TLS configuration is enabled.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toSecurityContext() SecurityContext?
Builds a SecurityContext if certificate paths are provided.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited