Skip to main content

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 example network-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.mode is not PLAIN_TEXT, the TLS block is validated after parsing.
  • When zeroMqEncryption.enabled is true, the zeroMqEncryption block is validated when the process starts its update queue.

Root schema​

The YAML root is the network config container. Top-level keys:

SectionTypeDefault / notes
messagingobjectmessaging section
nettyobjectnetty section
tlsobjecttls section (default: PLAIN_TEXT)
zeroMqEncryptionobjectzeroMqEncryption section (default: disabled)

Unknown top-level keys are ignored.


messaging section​

KeyTypeDefaultDescription
protocolstringV2Genesis net protocol: V1 or V2
serializationstringSMILEBinary message serialization: SMILE or JSON. MSGPACK is deprecated and resolves to SMILE
requestTimeoutinteger60Request-reply timeout in seconds
channelstringTCPTransport between processes: TCP or WEBSOCKET. A process on WEBSOCKET also serves native HTTP on the process port
transportModestringNATIVENATIVE or EXTERNAL. EXTERNAL is used by Spring-hosted processes
webSocketobject—WebSocket settings, used only when channel is WEBSOCKET (below)
httpobject—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​

KeyTypeDefaultDescription
pathstring/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
subProtocolsstring—Comma-separated sub-protocols to advertise
maxFrameSizeinteger64 MiBMaximum size of one frame, in bytes
maxAggregatedFrameSizeinteger64 MiBMaximum size of an aggregated message, in bytes
allowExtensionsbooleantrueAllow WebSocket extensions
forceCloseTimeoutMillisinteger-1How long to wait for the peer to complete a close handshake. A negative value turns the timeout off; 0 doesn't
compressionbooleanfalsePer-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.

KeyTypeDefaultDescription
maxInitialLineLengthinteger4096Maximum length of the request line
maxHeaderSizeinteger8192Maximum combined size of the headers
maxChunkSizeinteger8192Maximum size of one content chunk
validateHeadersbooleantrueValidate header names and values
initialBufferSizeinteger128Initial buffer size of the decoder
maxContentLengthinteger67108864 (64 MiB)Maximum size of a request body, in bytes
closeOnExpectationFailedbooleanfalseClose 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​

KeyTypeDefaultDescription
useNettyThreadsbooleanfalseUse Netty threads for message processing
socketobject—Socket options (below)

netty.socket​

KeyTypeDefaultDescription
soKeepALivebooleantrueTCP keep-alive
tcpNoDelaybooleantrueTCP 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​

KeyTypeDefaultDescription
modestringPLAIN_TEXTEncryption mode: PLAIN_TEXT, TLS, SELECTIVE_TLS, MUTUAL_TLS
protocolPolicyobject—tls.protocolPolicy
identityobject—tls.identity
trustobject—tls.trust
clientAuthstringAUTOClient auth (server-side): AUTO, NONE, OPTIONAL, REQUIRE. AUTO → NONE for TLS/SELECTIVE_TLS, REQUIRE for MUTUAL_TLS
peerVerificationobject—tls.peerVerification
authorizationobject—tls.authorization

Validation: tls.mode and tls.clientAuth must be valid enum values (see error messages in Validation summary).

tls.protocolPolicy​

KeyTypeDefaultDescription
minVersionstringTLSv1.2Minimum TLS version: TLSv1.2 or TLSv1.3
enabledProtocolslist of string[]e.g. ["TLSv1.2", "TLSv1.3"]
cipherSuiteslist of string[]Cipher suite names

Validation: minVersion must be TLSv1.2 or TLSv1.3.

tls.identity​

KeyTypeDefaultDescription
sourcestringNONENONE, CERTIFICATE, or KEYSTORE
certificateobject—Used when source: CERTIFICATE (below)
keystoreobject—Used when source: KEYSTORE (below)
reloadobject—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​

KeyTypeDefaultDescription
certChainPathstring""Path to certificate chain (e.g. PEM)
privateKeyPathstring""Path to private key
privateKeyPasswordstring""Optional password for encrypted key

Validation: certChainPath and privateKeyPath must not be blank when source is CERTIFICATE.

When identity.source: KEYSTORE​

KeyTypeDefaultDescription
typestringPKCS12PKCS12 or JKS
pathstring""Path to keystore file
storePasswordstring""Keystore password
keyAliasstring""Key alias
keyPasswordstring""Key password

Validation: path must not be blank and type must be valid when source is KEYSTORE.

identity.reload (certificate/keystore reload)​

KeyTypeDefaultDescription
enabledbooleanfalseEnable periodic reload
pollIntervalstring"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​

KeyTypeDefaultDescription
sourcestringSYSTEMSYSTEM, CERTIFICATE, or TRUSTSTORE
certificateobject—When source: CERTIFICATE (below)
truststoreobject—When source: TRUSTSTORE (below)
additionalCaBundleslist of string[]Additional CA bundle file paths

Validation: trust.source must be a valid enum.

When trust.source: CERTIFICATE​

KeyTypeDefaultDescription
caBundlePathstring""Path to CA bundle (e.g. PEM)

Validation: caBundlePath must not be blank when source is CERTIFICATE.

When trust.source: TRUSTSTORE​

KeyTypeDefaultDescription
typestringPKCS12PKCS12 or JKS
pathstring""Path to truststore file
storePasswordstring""Truststore password

Validation: path must not be blank and type must be valid when source is TRUSTSTORE.

tls.peerVerification​

KeyTypeDefaultDescription
modestringAUTOAUTO, HOSTNAME, or CERT_IDENTITY
hostnameobject—Hostname verification (below)

tls.peerVerification.hostname​

KeyTypeDefaultDescription
enabledbooleantrueEnable hostname verification

Validation: peerVerification.mode must be a valid enum value.

tls.authorization​

KeyTypeDefaultDescription
enabledbooleanfalseEnable authorization checks
defaultDecisionstringDENYDefault decision: DENY or ALLOW
identitySourceobject—Where to take identity from (below)
allowobject—Allow list (identities + patterns)
denyobject—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​

KeyTypeDefaultDescription
sanTypestringURISAN type used for identity: URI or DNS

tls.authorization.allow / tls.authorization.deny (identity list policy)​

KeyTypeDefaultDescription
identitieslist of string[]Exact identity values
identityPatternslist 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.

KeyTypeDefaultDescription
enabledbooleanfalseTurns on CURVE for update-queue traffic. When this is false, the update queue behaves as it does without this section
zapDomainstringgenesis-internalZAP domain that servers use to authenticate clients. Any value; every process must use the same one
curveServerPublicKeystring""Server public key, Z85 text
curveServerSecretKeystring""Server secret key, Z85 text
curveClientPublicKeystring""Client public key, Z85 text
curveClientSecretKeystring""Client secret key, Z85 text
allowedClientCertDirectorystring""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
readinessTimeoutMillisinteger5000How 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
readinessObserveOnlybooleanfalseIf 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:

ConditionError 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 blankallowedClientCertDirectory is required when ZeroMQ CURVE is enabled
allowedClientCertDirectory isn't a readable directoryallowedClientCertDirectory 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:

ConditionError message
tls.mode invalid/unknowntls.mode must be a valid mode (PLAIN_TEXT, TLS, SELECTIVE_TLS or MUTUAL_TLS)
tls.clientAuth invalid/unknowntls.clientAuth must be a valid client auth mode (AUTO, NONE, OPTIONAL, or REQUIRE)
protocolPolicy.minVersion invalid/unknownprotocolPolicy.minVersion must be a valid TLS version (TLSv1.2 or TLSv1.3)
tls.mode: MUTUAL_TLS but identity.source not CERTIFICATE/KEYSTOREtls.identity.source must be configured (CERTIFICATE or KEYSTORE) when mode is MUTUAL_TLS
identity.source invalid/unknownidentity.source must be a valid source (NONE, CERTIFICATE, or KEYSTORE)
CERTIFICATE identity but blank certChainPathidentity.certificate.certChainPath must not be blank when CERTIFICATE identity source is used
CERTIFICATE identity but blank privateKeyPathidentity.certificate.privateKeyPath must not be blank when CERTIFICATE identity source is used
KEYSTORE identity but blank pathidentity.keystore.path must not be blank when KEYSTORE identity source is used
KEYSTORE identity but invalid typeidentity.keystore.type must be a valid store type (PKCS12 or JKS)
Reload enabled but blank pollIntervalidentity.reload.pollInterval must not be blank when reload is enabled
Reload enabled but invalid pollInterval formatidentity.reload.pollInterval must be a valid duration string (e.g., '60s', '5m', '1h', '1d')
trust.source invalid/unknowntrust.source must be a valid source (SYSTEM, CERTIFICATE, or TRUSTSTORE)
CERTIFICATE trust but blank caBundlePathtrust.certificate.caBundlePath must not be blank when CERTIFICATE trust source is used
TRUSTSTORE trust but blank pathtrust.truststore.path must not be blank when TRUSTSTORE trust source is used
TRUSTSTORE trust but invalid typetrust.truststore.type must be a valid store type (PKCS12 or JKS)
peerVerification.mode invalid/unknownpeerVerification.mode must be a valid mode (AUTO, HOSTNAME, or CERT_IDENTITY)
Authorization enabled but defaultDecision invalid/unknownauthorization.defaultDecision must be a valid decision (DENY or ALLOW)
Authorization enabled but identitySource.sanType invalid/unknownauthorization.identitySource.sanType must be a valid SAN type (URI or DNS)
Authorization enabled but both allow and deny emptyauthorization 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​

EnumAllowed 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):

EnumAllowed 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