Network configuration YAML reference
This document describes the YAML configuration for the Genesis network layer. The file is deserialized into NetworkConfigContainer and supports messaging, Netty, and TLS settings.
Introduction and file usage
Purpose
The network configuration drives:
- Messaging: protocol version, serialization format, request-reply timeout, transport channel
- Netty: thread usage and socket options
- TLS: encryption mode, identity/trust, client auth, peer verification, and authorization
- ZeroMQ encryption: CURVE authentication and encryption for the ZeroMQ update queue
File names and merge behaviour
- Application-level:
network-config.yaml(loaded first) - Process-level (optional):
network-config-<PROCESS_NAME>.yaml, for examplenetwork-config-GENESIS_CLUSTER.yaml(overrides application config for that process)
If both files are present, process level configuration will overwrite any global settings.
In a project, put network-config.yaml and any network-config-<PROCESS_NAME>.yaml files in your application module's src/main/genesis/cfg/ directory. The build deploys them to site-specific/cfg/. See step 2 of Enabling CURVE for an example.
At runtime each file is looked up by name, first in generated/cfg/, then in site-specific/cfg/, then in each product's cfg/ folder under GENESIS_HOME. The first copy found is used, so a file in site-specific/cfg/ replaces the application's copy for that deployment instead of merging with it.
Environment placeholders
Environment variable placeholders in the YAML are resolved when the config is loaded, use ${...} to refer to environmental variables.
Validation
- When
tls.modeis notPLAIN_TEXT, the TLS block is validated after parsing. - When
zeroMqEncryption.enabledistrue, thezeroMqEncryptionblock is validated when the process starts its update queue.
Root schema
The YAML root is the network config container. Top-level keys:
| Section | Type | Default / notes |
|---|---|---|
messaging | object | messaging section |
netty | object | netty section |
tls | object | tls section (default: PLAIN_TEXT) |
zeroMqEncryption | object | zeroMqEncryption section (default: disabled) |
Unknown top-level keys are ignored.
messaging section
| Key | Type | Default | Description |
|---|---|---|---|
protocol | string | V2 | Genesis net protocol: V1 or V2 |
serialization | string | SMILE | Binary message serialization: SMILE or JSON. MSGPACK is deprecated and resolves to SMILE |
requestTimeout | integer | 60 | Request-reply timeout in seconds |
channel | string | TCP | Transport between processes: TCP or WEBSOCKET. A process on WEBSOCKET also serves native HTTP on the process port |
transportMode | string | NATIVE | NATIVE or EXTERNAL. EXTERNAL is used by Spring-hosted processes |
webSocket | object | — | WebSocket settings, used only when channel is WEBSOCKET (below) |
http | object | — | HTTP settings for the process port, used only when channel is WEBSOCKET (below) |
There is no TLS-style validator for this section; values are used as configured.
The webSocket and http blocks ignore keys they don't recognise, so a misspelt key is ignored silently: there is no error and nothing is logged, so check the spelling against this table.
messaging:
channel: WEBSOCKET
serialization: SMILE
http:
maxInitialLineLength: 8192
messaging.webSocket
| Key | Type | Default | Description |
|---|---|---|---|
path | string | / | WebSocket endpoint path, on both the server and the client. A client connects using its own path, not the target's, so every process that talks to another must use the same path. Set it in network-config.yaml, not a per-process file, or clients of that process (including the router) can't connect |
subProtocols | string | — | Comma-separated sub-protocols to advertise |
maxFrameSize | integer | 64 MiB | Maximum size of one frame, in bytes |
maxAggregatedFrameSize | integer | 64 MiB | Maximum size of an aggregated message, in bytes |
allowExtensions | boolean | true | Allow WebSocket extensions |
forceCloseTimeoutMillis | integer | -1 | How long to wait for the peer to complete a close handshake. A negative value turns the timeout off; 0 doesn't |
compression | boolean | false | Per-message deflate compression |
messaging.http
These settings tune HTTP handling on the process port when channel is WEBSOCKET, and mirror the router's httpServerCodec and httpObjectAggregator blocks. One default differs: maxContentLength is 67108864 bytes (64 MiB) here, but 262144 bytes on the router.
| Key | Type | Default | Description |
|---|---|---|---|
maxInitialLineLength | integer | 4096 | Maximum length of the request line |
maxHeaderSize | integer | 8192 | Maximum combined size of the headers |
maxChunkSize | integer | 8192 | Maximum size of one content chunk |
validateHeaders | boolean | true | Validate header names and values |
initialBufferSize | integer | 128 | Initial buffer size of the decoder |
maxContentLength | integer | 67108864 (64 MiB) | Maximum size of a request body, in bytes |
closeOnExpectationFailed | boolean | false | Close the connection when an Expect: 100-continue request is too large |
When a request exceeds one of these limits, the caller gets a plain-text error reply and the connection is closed:
- Request line longer than
maxInitialLineLength:414 URI Too Long. - Headers larger than
maxHeaderSize:431 Request Header Fields Too Large. - Any other request that fails to decode:
400 Bad Request.
A body larger than maxContentLength gets 413 Request Entity Too Large.
netty section
| Key | Type | Default | Description |
|---|---|---|---|
useNettyThreads | boolean | false | Use Netty threads for message processing |
socket | object | — | Socket options (below) |
netty.socket
| Key | Type | Default | Description |
|---|---|---|---|
soKeepALive | boolean | true | TCP keep-alive |
tcpNoDelay | boolean | true | TCP no-delay (Nagle off) |
tls section
When tls.mode is not PLAIN_TEXT, the TLS subtree is validated. Invalid or unknown enum values (e.g. typos) can produce validation errors.
Note: tls.observability is not documented here (not yet implemented).
Top-level TLS
| Key | Type | Default | Description |
|---|---|---|---|
mode | string | PLAIN_TEXT | Encryption mode: PLAIN_TEXT, TLS, SELECTIVE_TLS, MUTUAL_TLS |
protocolPolicy | object | — | tls.protocolPolicy |
identity | object | — | tls.identity |
trust | object | — | tls.trust |
clientAuth | string | AUTO | Client auth (server-side): AUTO, NONE, OPTIONAL, REQUIRE. AUTO → NONE for TLS/SELECTIVE_TLS, REQUIRE for MUTUAL_TLS |
peerVerification | object | — | tls.peerVerification |
authorization | object | — | tls.authorization |
Validation: tls.mode and tls.clientAuth must be valid enum values (see error messages in Validation summary).
tls.protocolPolicy
| Key | Type | Default | Description |
|---|---|---|---|
minVersion | string | TLSv1.2 | Minimum TLS version: TLSv1.2 or TLSv1.3 |
enabledProtocols | list of string | [] | e.g. ["TLSv1.2", "TLSv1.3"] |
cipherSuites | list of string | [] | Cipher suite names |
Validation: minVersion must be TLSv1.2 or TLSv1.3.
tls.identity
| Key | Type | Default | Description |
|---|---|---|---|
source | string | NONE | NONE, CERTIFICATE, or KEYSTORE |
certificate | object | — | Used when source: CERTIFICATE (below) |
keystore | object | — | Used when source: KEYSTORE (below) |
reload | object | — | Certificate/keystore reload (below) |
Validation: When tls.mode is MUTUAL_TLS, identity.source must be CERTIFICATE or KEYSTORE. identity.source must be a valid enum.
When identity.source: CERTIFICATE
| Key | Type | Default | Description |
|---|---|---|---|
certChainPath | string | "" | Path to certificate chain (e.g. PEM) |
privateKeyPath | string | "" | Path to private key |
privateKeyPassword | string | "" | Optional password for encrypted key |
Validation: certChainPath and privateKeyPath must not be blank when source is CERTIFICATE.
When identity.source: KEYSTORE
| Key | Type | Default | Description |
|---|---|---|---|
type | string | PKCS12 | PKCS12 or JKS |
path | string | "" | Path to keystore file |
storePassword | string | "" | Keystore password |
keyAlias | string | "" | Key alias |
keyPassword | string | "" | Key password |
Validation: path must not be blank and type must be valid when source is KEYSTORE.
identity.reload (certificate/keystore reload)
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable periodic reload |
pollInterval | string | "60s" | Duration: e.g. 60s, 5m, 1h, 1d (pattern: \d+[smhd]) |
Validation: When reload is enabled, pollInterval must not be blank and must match the duration pattern (e.g. 60s, 5m, 1h, 1d).
tls.trust
| Key | Type | Default | Description |
|---|---|---|---|
source | string | SYSTEM | SYSTEM, CERTIFICATE, or TRUSTSTORE |
certificate | object | — | When source: CERTIFICATE (below) |
truststore | object | — | When source: TRUSTSTORE (below) |
additionalCaBundles | list of string | [] | Additional CA bundle file paths |
Validation: trust.source must be a valid enum.
When trust.source: CERTIFICATE
| Key | Type | Default | Description |
|---|---|---|---|
caBundlePath | string | "" | Path to CA bundle (e.g. PEM) |
Validation: caBundlePath must not be blank when source is CERTIFICATE.
When trust.source: TRUSTSTORE
| Key | Type | Default | Description |
|---|---|---|---|
type | string | PKCS12 | PKCS12 or JKS |
path | string | "" | Path to truststore file |
storePassword | string | "" | Truststore password |
Validation: path must not be blank and type must be valid when source is TRUSTSTORE.
tls.peerVerification
| Key | Type | Default | Description |
|---|---|---|---|
mode | string | AUTO | AUTO, HOSTNAME, or CERT_IDENTITY |
hostname | object | — | Hostname verification (below) |
tls.peerVerification.hostname
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable hostname verification |
Validation: peerVerification.mode must be a valid enum value.
tls.authorization
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable authorization checks |
defaultDecision | string | DENY | Default decision: DENY or ALLOW |
identitySource | object | — | Where to take identity from (below) |
allow | object | — | Allow list (identities + patterns) |
deny | object | — | Deny list (identities + patterns) |
A connection without a client certificate follows defaultDecision. The router's web port (its HTTP and WebSocket listener) is the exception: it checks a client that presents a certificate against these rules, and lets in a client that presents none, such as a browser.
When a connection is denied, the process logs a WARN line TLS authorization denied for peer identity <identity> from <peer> on <listener>. Further denials of the same identity on the same listener are logged at DEBUG for 5 minutes.
tls.authorization.identitySource
| Key | Type | Default | Description |
|---|---|---|---|
sanType | string | URI | SAN type used for identity: URI or DNS |
tls.authorization.allow / tls.authorization.deny (identity list policy)
| Key | Type | Default | Description |
|---|---|---|---|
identities | list of string | [] | Exact identity values |
identityPatterns | list of string | [] | Regex patterns for identities |
Validation: When authorization is enabled: defaultDecision and identitySource.sanType must be valid; at least one of allow or deny must have non-empty identities or identityPatterns (otherwise: "authorization is enabled but no allow or deny rules are configured").
zeroMqEncryption section
This section configures CURVE authentication and encryption for the ZeroMQ update queue. It only has an effect when MqLayer is ZeroMQ. CURVE is off by default. The GenerateZeroMqCurveKeys command generates the keys and prints a block you can paste in.
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Turns on CURVE for update-queue traffic. When this is false, the update queue behaves as it does without this section |
zapDomain | string | genesis-internal | ZAP domain that servers use to authenticate clients. Any value; every process must use the same one |
curveServerPublicKey | string | "" | Server public key, Z85 text |
curveServerSecretKey | string | "" | Server secret key, Z85 text |
curveClientPublicKey | string | "" | Client public key, Z85 text |
curveClientSecretKey | string | "" | Client secret key, Z85 text |
allowedClientCertDirectory | string | "" | Directory of client certificates. A server accepts only clients whose public key has a certificate here. Any standard ZeroMQ certificate file works, including ones produced by other ZeroMQ tools; see Using keys issued elsewhere. Any file name works: the server loads every file in the directory and its subdirectories, and skips (with a warning) any file without a CURVE public key. The directory is checked when a client connects, so adding or removing a certificate takes effect for new connections without a restart; connections already open are not affected |
readinessTimeoutMillis | integer | 5000 | How long, in milliseconds, a publisher holds a message for a topic that no subscriber has subscribed to yet. After that, the message is sent anyway |
readinessObserveOnly | boolean | false | If true, the publisher tracks subscriber readiness but never holds messages back |
Every process is both a ZeroMQ server (it publishes) and a ZeroMQ client (it subscribes to its peers), so each one needs both secret keys. As a server (the publishing side) a process uses the server keypair, curveServerPublicKey and curveServerSecretKey. As a client (the subscribing side) it uses the client keypair, curveClientPublicKey and curveClientSecretKey, and authenticates the server by its curveServerPublicKey.
Use environment variable placeholders for the keys, so the secrets stay out of the file:
zeroMqEncryption:
enabled: true
zapDomain: genesis-internal
curveServerPublicKey: ${ZMQ_CURVE_SERVER_PUBLIC}
curveServerSecretKey: ${ZMQ_CURVE_SERVER_SECRET}
curveClientPublicKey: ${ZMQ_CURVE_CLIENT_PUBLIC}
curveClientSecretKey: ${ZMQ_CURVE_CLIENT_SECRET}
allowedClientCertDirectory: ${GENESIS_HOME}/site-specific/cfg/zmq-curve-clients
Every process has to use the same enabled value and the same keys. If a process-level network-config-{processName}.yaml sets this section differently, the override is honoured and that process's handshakes with its peers fail. Never do this in production; only use it to test a mismatch.
Validation: When enabled is true, the process fails to start if one of these conditions isn't met:
| Condition | Error message |
|---|---|
| A key is missing or blank | <key> is required when ZeroMQ CURVE is enabled |
A key is still an unresolved ${VAR} reference, because the environment variable isn't set | <key> was not resolved: set the <VAR> environment variable, or disable ZeroMQ CURVE |
| A key isn't exactly 40 characters | <key> must be 40 characters of Z85, but is <length> |
| A key isn't valid Z85. Z85 is ZeroMQ's 85-character text encoding (RFC 32); a 40-character key containing a space, quote or comma is not valid Z85 | <key> must be a valid Z85 CURVE key |
allowedClientCertDirectory is missing or blank | allowedClientCertDirectory is required when ZeroMQ CURVE is enabled |
allowedClientCertDirectory isn't a readable directory | allowedClientCertDirectory must be a readable directory: '<path>' |
<key> is the YAML key name, for example curveServerPublicKey. The secret keys are hidden in log output.
Validation summary
When TLS is enabled (tls.mode ≠ PLAIN_TEXT), the following conditions are enforced. Violations produce the corresponding error message:
| Condition | Error message |
|---|---|
tls.mode invalid/unknown | tls.mode must be a valid mode (PLAIN_TEXT, TLS, SELECTIVE_TLS or MUTUAL_TLS) |
tls.clientAuth invalid/unknown | tls.clientAuth must be a valid client auth mode (AUTO, NONE, OPTIONAL, or REQUIRE) |
protocolPolicy.minVersion invalid/unknown | protocolPolicy.minVersion must be a valid TLS version (TLSv1.2 or TLSv1.3) |
tls.mode: MUTUAL_TLS but identity.source not CERTIFICATE/KEYSTORE | tls.identity.source must be configured (CERTIFICATE or KEYSTORE) when mode is MUTUAL_TLS |
identity.source invalid/unknown | identity.source must be a valid source (NONE, CERTIFICATE, or KEYSTORE) |
CERTIFICATE identity but blank certChainPath | identity.certificate.certChainPath must not be blank when CERTIFICATE identity source is used |
CERTIFICATE identity but blank privateKeyPath | identity.certificate.privateKeyPath must not be blank when CERTIFICATE identity source is used |
KEYSTORE identity but blank path | identity.keystore.path must not be blank when KEYSTORE identity source is used |
KEYSTORE identity but invalid type | identity.keystore.type must be a valid store type (PKCS12 or JKS) |
Reload enabled but blank pollInterval | identity.reload.pollInterval must not be blank when reload is enabled |
Reload enabled but invalid pollInterval format | identity.reload.pollInterval must be a valid duration string (e.g., '60s', '5m', '1h', '1d') |
trust.source invalid/unknown | trust.source must be a valid source (SYSTEM, CERTIFICATE, or TRUSTSTORE) |
CERTIFICATE trust but blank caBundlePath | trust.certificate.caBundlePath must not be blank when CERTIFICATE trust source is used |
TRUSTSTORE trust but blank path | trust.truststore.path must not be blank when TRUSTSTORE trust source is used |
TRUSTSTORE trust but invalid type | trust.truststore.type must be a valid store type (PKCS12 or JKS) |
peerVerification.mode invalid/unknown | peerVerification.mode must be a valid mode (AUTO, HOSTNAME, or CERT_IDENTITY) |
Authorization enabled but defaultDecision invalid/unknown | authorization.defaultDecision must be a valid decision (DENY or ALLOW) |
Authorization enabled but identitySource.sanType invalid/unknown | authorization.identitySource.sanType must be a valid SAN type (URI or DNS) |
| Authorization enabled but both allow and deny empty | authorization is enabled but no allow or deny rules are configured |
Full YAML examples
Example 1: Minimal (plain text, TLS disabled)
tls:
mode: PLAIN_TEXT
Example 2: Server TLS with PEM identity and system trust
tls:
mode: TLS
identity:
source: CERTIFICATE
certificate:
certChainPath: /etc/certs/server.crt
privateKeyPath: /etc/certs/server.key
trust:
source: SYSTEM
protocolPolicy:
minVersion: TLSv1.2
Example 3: MUTUAL_TLS with CERTIFICATE identity and trust, plus authorization
tls:
mode: MUTUAL_TLS
identity:
source: CERTIFICATE
certificate:
certChainPath: /etc/certs/server.crt
privateKeyPath: /etc/certs/server.key
trust:
source: CERTIFICATE
certificate:
caBundlePath: /etc/certs/ca-bundle.crt
protocolPolicy:
minVersion: TLSv1.3
authorization:
enabled: true
defaultDecision: DENY
identitySource:
sanType: URI
allow:
identities:
- "spiffe://example.com/service/allowed"
identityPatterns:
- "spiffe://example.com/service/.*"
Example 4: MUTUAL_TLS with full options (no observability)
tls:
mode: MUTUAL_TLS
clientAuth: REQUIRE
protocolPolicy:
minVersion: TLSv1.3
enabledProtocols:
- TLSv1.3
cipherSuites:
- TLS_AES_256_GCM_SHA384
- TLS_AES_128_GCM_SHA256
identity:
source: CERTIFICATE
certificate:
certChainPath: /etc/certs/server.crt
privateKeyPath: /etc/certs/server.key
privateKeyPassword: secret
reload:
enabled: true
pollInterval: 5m
trust:
source: CERTIFICATE
certificate:
caBundlePath: /etc/certs/ca-bundle.crt
additionalCaBundles:
- /etc/certs/additional-ca.crt
peerVerification:
mode: CERT_IDENTITY
hostname:
enabled: false
authorization:
enabled: true
defaultDecision: DENY
identitySource:
sanType: URI
allow:
identities:
- "spiffe://example.com/service/api"
identityPatterns:
- "spiffe://example.com/service/.*"
Enum reference
| Enum | Allowed values |
|---|---|
EncryptionMode (tls.mode) | PLAIN_TEXT, TLS, SELECTIVE_TLS, MUTUAL_TLS |
TlsVersion (protocolPolicy.minVersion) | TLSv1.2, TLSv1.3 |
IdentitySource (identity.source) | NONE, CERTIFICATE, KEYSTORE |
TrustSource (trust.source) | SYSTEM, CERTIFICATE, TRUSTSTORE |
StoreType (identity/trust store type) | PKCS12, JKS |
ClientAuthMode (tls.clientAuth) | AUTO, NONE, OPTIONAL, REQUIRE |
PeerVerificationMode (peerVerification.mode) | AUTO, HOSTNAME, CERT_IDENTITY |
SanType (authorization.identitySource.sanType) | URI, DNS |
DefaultDecision (authorization.defaultDecision) | DENY, ALLOW |
Messaging (root):
| Enum | Allowed values |
|---|---|
GenesisNetProtocol (messaging.protocol) | V1, V2 |
MessageSerialization (messaging.serialization) | SMILE, JSON; MSGPACK is deprecated and resolves to SMILE |
ChannelType (messaging.channel) | TCP, WEBSOCKET |
TransportMode (messaging.transportMode) | NATIVE, EXTERNAL |