ssl.toml Configuration Reference#

config/ssl.toml configures server certificates and TLS connections for a Dioptra deployment. For setup instructions, see Configure SSL/TLS Certificates. For certificate requirements, see Certificate Policy Reference.

Location and Path Rules#

The file is located at config/ssl.toml within the deployment directory. Paths in this file are relative to the deployment directory.

Unknown fields, invalid values, and unsupported configuration versions are rejected.

Top-Level Fields#

schema_version#

Type

Integer.

Required value

1.

Identifies the configuration format. Other versions are rejected.

[public] Section#

host#

Type

String.

Required

Yes.

The DNS name or IP address that browsers and external clients use to reach the deployment. The nginx server certificate must cover this name or address. The deployment template sets this field from nginx_server_name, which defaults to localhost.

Use the following guidelines when choosing a value:

  • Specify a hostname or IP address without a URL scheme, port, path, or wildcard.

  • Use localhost for access from the deployment machine.

  • If you use a hostname, it must resolve to the deployment’s address.

Ports and bind addresses are configured in Compose. Changing the hostname requires a certificate covering the new name; changing only the port does not.

For example, a deployment accessed at https://dioptra.example.org uses:

[public]
host = "dioptra.example.org"

[transport] Section#

key_exchange#

Type

String.

Default

"default".

Controls the key-exchange method used for TLS connections. Both modes require TLS 1.3. The accepted values are:

"default"

Lets the client and server negotiate the key-exchange method normally.

"hybrid-required"

Requires X25519MLKEM768. Connections fail if either side cannot support it.

Compatibility

The Python 3.11 images support "default". The "hybrid-required" mode has these additional requirements:

  • The Python API and Python clients require Python 3.15 or newer linked to OpenSSL with X25519MLKEM768 support.

  • nginx and its clients or upstream servers must also support and enforce this group.

See also

For certificate algorithms and expiration requirements, see Certificate Policy Reference.

[restapi] and [nginx] Sections#

The [restapi] and [nginx] sections configure certificates for the API and nginx independently. Both sections accept the fields described below.

Certificate and private key files use these paths, relative to the deployment directory:

Section

Server certificate

Private key

[restapi]

ssl/restapi/server.crt

ssl/restapi/server.key

[nginx]

ssl/nginx/server.crt

ssl/nginx/server.key

source#

Type

String.

Default

"generated".

Selects how the service’s server certificate is obtained. The accepted values are:

"generated"

Dioptra creates missing server certificates during initialization and signs them with the deployment’s CA.

"supplied"

You provide the server certificate, any required intermediate certificates, and the associated private key. You also specify the root CA certificate in trust_files.

Changing this value after initialization requires certificate replacement.

dns_sans#

Type

Array of DNS-name strings.

Default

[].

Lists additional DNS names that the service’s certificate must cover. Dioptra includes these names in generated certificates and checks supplied certificates for them.

The following names are already required and do not need to be repeated in this array:

  • For [restapi], the deployment’s internal API hostname, <deployment-slug>-restapi.

  • For [nginx], the hostname in public.host, when that value is a DNS name.

Adding names here does not configure DNS records or change the public hostname used to access Dioptra.

ip_sans#

Type

Array of IPv4 or IPv6 literal strings.

Default

[].

Lists additional IPv4 or IPv6 addresses that the service’s certificate must cover. Dioptra includes these addresses in generated certificates and checks supplied certificates for them.

For [nginx], an IP address in public.host is already required and does not need to be repeated in this array. Adding addresses here does not change the deployment’s bind addresses or published ports, which are configured in Compose.

trust_files#

Type

Array of path strings.

Default

[].

Lists paths to public root CA certificates used to verify the service’s server certificate. These files must contain CA certificates, not server certificate bundles or private keys.

CA certificate files must be stored under ssl/ca-certificates/, which Dioptra uses to distribute additional trusted CAs to its container services. Each file must use PEM format and a .crt filename extension. Specify paths relative to the deployment directory.

  • When source = "supplied", specify the required root CA certificate files, even if the CA is already publicly trusted.

  • When source = "generated", Dioptra selects its CA automatically. Conflicting entries are rejected.

For example, nginx can use a supplied certificate verified by ssl/ca-certificates/root-ca.crt:

[nginx]
source = "supplied"
trust_files = ["ssl/ca-certificates/root-ca.crt"]

Example#

This example uses Dioptra-generated certificates for both services, localhost as the public hostname, and the default TLS 1.3 key-exchange settings:

schema_version = 1

[public]
host = "localhost"

[transport]
key_exchange = "default"

[restapi]
source = "generated"
dns_sans = []
ip_sans = []
trust_files = []

[nginx]
source = "generated"
dns_sans = []
ip_sans = []
trust_files = []

See Configure SSL/TLS Certificates to supply certificates for one or both endpoints.