Package io.floci.testcontainers.config
Class TlsConfig.Builder
java.lang.Object
io.floci.testcontainers.config.TlsConfig.Builder
- Enclosing class:
- TlsConfig
Builder for
TlsConfig.-
Method Summary
Modifier and TypeMethodDescriptionawsHttpsPort(int awsHttpsPort) Sets the additional port the TLS proxy binds for AWS-style HTTPS traffic, alongside the public Floci port.build()Creates an immutableTlsConfigfrom this builder.Sets the path to the PEM certificate file.enabled(boolean enabled) Enables or disables TLS/HTTPS on the server.Sets the path to the PEM private key file.selfSigned(boolean selfSigned) Sets whether a self-signed certificate should be auto-generated when nocertPath/keyPathis provided.
-
Method Details
-
enabled
Enables or disables TLS/HTTPS on the server.- Parameters:
enabled-trueto enable (default false)- Returns:
- this builder
-
certPath
Sets the path to the PEM certificate file. When set together withkeyPath(String), the provided certificate is used instead of a generated one.- Parameters:
certPath- the path to the PEM certificate file, ornullto unset- Returns:
- this builder
-
keyPath
Sets the path to the PEM private key file. When set together withcertPath(String), the provided key is used instead of a generated one.- Parameters:
keyPath- the path to the PEM private key file, ornullto unset- Returns:
- this builder
-
selfSigned
Sets whether a self-signed certificate should be auto-generated when nocertPath/keyPathis provided. The generated files are persisted to{storage.persistent-path}/tls/and reused across restarts.- Parameters:
selfSigned-trueto auto-generate a self-signed certificate (default true)- Returns:
- this builder
-
awsHttpsPort
Sets the additional port the TLS proxy binds for AWS-style HTTPS traffic, alongside the public Floci port.CDK/CloudFormation custom resources send their
cfn-responsecallback with bundled code that hardcodeshttps://and ignores the port in the ResponseURL, so the PUT lands on the conventional 443 regardless of Floci's configured port. Binding 443 here (with the same HTTP/HTTPS protocol detection used on the main port) lets those callbacks — and any other client that assumes AWS lives on 443 — reach Floci.Set to
0to disable the extra binding (e.g. when Floci runs unprivileged or another process owns 443). When equal to the main Floci port only a single listener is started.- Parameters:
awsHttpsPort- the additional AWS-style HTTPS port (default 443)- Returns:
- this builder
-
build
Creates an immutableTlsConfigfrom this builder.- Returns:
- the TLS configuration
-