Product knowledge · Advanced · Security boundary

Encrypting the path does not decide who may do what.

Protocol selection, transport-peer authentication and business authorization are three separate decisions. CoAkka HTTP Runtime owns the first two at the HTTP edge; the application always owns the last.

01 · Three decisions

Three protection layers, three owners

1

Can this protocol run on this target?

The application submits intent; the exact loaded package reports capability and effective backend. An API enum does not prove a provider exists.

2

Who is the transport peer?

The runtime validates TLS material, performs the handshake and fails closed when identity or trust is invalid.

3

What may that peer do?

The application combines verified peer facts with token, session and business policy to authorize a route and action.

TLS does not replace authorization. mTLS can prove that a client presented a trusted certificate, but Core does not decide which customer it represents or whether it may charge, read a record or call an administrative route.

02 · Security modes

Choose the mode for the real trust boundary

ModeServer identityClient identityListener material
PlaintextNoneNoneTLS fields empty; credential generation is zero.
TLSClient verifies server certificateNot requiredNonzero generation, credential ID, certificate chain and private key.
mTLSClient verifies server certificateServer verifies client certificateTLS material plus trust roots for client identity.

When a reverse proxy terminates TLS, that proxy owns its certificate and rotation. Document whether the backend hop uses plaintext, TLS or mTLS; a successful proxy handshake does not prove CoAkka listener reload.

03 · Listener declaration

Each field answers a different question

Protocol
HTTP_1_1 is the portable baseline. Select HTTP/2 or HTTP/3 only when the exact package and target report that capability.
Security mode
Plaintext, TLS or mutual TLS. The loaded target must still report the selected security provider.
Credential ID
A stable name for the logical identity, such as partner-api; it contains no secret.
Credential generation
The deployment-selected revision of the material. It is not a file watcher, timestamp, distributed lock or handshake proof.
Certificate chain
The server identity chain the peer verifies; keep its path and mount under deployment secret policy.
Private key
The key matching the certificate. Never bake it into an image, log it, retain it in monitor detail or return it in a response.
Trust roots
Required for mTLS client-certificate verification; they are not an application allow-list.
listener intent
  address + port
  protocol + security mode
  credential ID + generation
  certificate chain + private key
  trust roots (mTLS only)
            ↓ copy / freeze / validate / bind
accepted → effective listener facts
rejected → typed startup failure; never report ready

04 · Capability before configuration

The public API is vocabulary; the loaded package is evidence

HTTP/1.1

Built-in baseline. Still verify handshake, response, bounds and resource return on the matching host.

HTTP/2 and HTTP/3

Shared contract but feature-gated per target. Never infer support from an enum or package presence.

TLS provider

A security API does not make a provider appear. Unsupported combinations fail rather than silently downgrade.

Effective backend

Read the protocol and backend the runtime accepted. Linux io_uring is only for eligible HTTP/2/3 configurations, not an HTTP/1.1 label.

05 · Application boundary

Verified identity is input, not a business decision

Runtime-owned

Protocol/security validation, handshake, peer trust facts, connection lifetime and transport failure.

Application-owned

Map peer, token or session to principal, tenant, role, route/action policy and a user-safe refusal.

Deployment-owned

Secret distribution, file permissions, certificate issue/revoke, firewall, DNS, ingress and rollout budget.

Never log

Private keys, tokens, cookies, raw certificates or peer-certificate bytes. Log stable redacted identity and failure facts.

06 · Fail closed by stage

A failure before the handler has a different meaning

StageExampleSafe conclusion
StartupMalformed PEM, key mismatch, missing material, unsupported protocol/securityListener is not ready; fix declaration, package or deployment.
HandshakeUnknown CA, expired/not-yet-valid certificate, name/policy mismatch, missing client certificateFail closed before the application handler.
AuthorizationVerified peer lacks permission for the route or actionApplication returns a safe refusal; transport identity may still be valid.
ReloadStale generation or incomplete/invalid candidateRefuse the candidate; preserve the old effective credential.
RolloutNew instance starts but handshake/request verification failsKeep it out of ingress; the old instance continues serving.

07 · Credential reload · SDK 2.3.0

Publication and retirement are separate outcomes

This workflow applies to standalone listeners. Listener V1 has no mTLS or live credential reload in this release.

1

Prepare a complete candidate

Use distinct paths for the chain, matching key and intended trust roots; never mutate files beneath the live listener.

2

Read the effective generation

Obtain the current generation from the running listener; do not guess the next number from local state.

3

Apply with expected generation

Submit the complete set. A stale or invalid candidate is refused and the old effective state stays intact.

4

Verify with a new connection

Perform a real handshake and request; for mTLS, verify both trusted-client acceptance and untrusted-client refusal.

5

Observe retirement

Remove old deployment material only after retirement. Existing connections are not re-authenticated against new trust.

Changing a file is not reload. Overwriting a PEM, replacing a symlink, incrementing a generation or swapping a handler does not change a live listener's identity.

08 · Replacement service

Changing address or protocol is a rollout, not credential reload

prepare new service at a distinct endpoint
  → start and read effective facts
  → real handshake + request (+ negative mTLS case)
  → admit replacement to ingress
  → stop selecting old instance
  → finite close old service
  → remove old resources only after successful convergence

Use replacement when the package or listener lacks reload, or when changing address or protocol. Two services cannot be assumed to bind the same endpoint; a single process slot may cause interruption. This recipe does not promise zero downtime. A compromised credential may require terminating old sessions instead of a normal drain.

09 · Verification checklist

Successful startup is not enough evidence