Skip to content

Security

TLS is on by default and the server certificate is verified. Everything below is either turning that off for local development, or telling the client who to trust and who you are.

Every example in these docs connects to a local development node, which is why they carry tls=false. That is a mode you opted into, not a default. Know which one you are in.

Development Production
Connection string kurrentdb://localhost:2113?tls=false kurrentdb+discover://cluster:2113
Transport Plain HTTP/2, nothing encrypted TLS, certificate verified
Server identity Not checked Checked against a CA you trust
Credentials The seeded admin account An identity you created, read from configuration

Production needs no extra parameter. Drop tls=false and TLS is on, verified against the system trust store.

kurrentdb+discover://admin:changeit@cluster.example.internal:2113

Read the credentials from configuration rather than a literal, the same as any other secret.

await using var client = KurrentClient.Create(builder.Configuration.GetConnectionString("Kurrent")!);

When the cluster certificate is signed by your own CA, give the client the CA bundle.

kurrentdb+discover://admin:changeit@cluster:2113?tlsCaFile=/certs/ca.crt
opts.Security = KurrentClientSecurityOptions.MutualTls(
clientCertPath: "/certs/client.crt",
clientKeyPath: "/certs/client.key",
rootCaPath: "/certs/ca.crt");

Both forms keep verification on. They change who the client trusts, not whether it checks.

Three ways, and they resolve in this order.

Method How
Certificate userCertFile and userKeyFile, plus userKeyPassword if the key is encrypted
Username and password The userinfo part of the connection string, percent-encoded
None Neither supplied

Certificate credentials win when both are present.

kurrentdb://admin:changeit@localhost:2113
kurrentdb://user%40domain:p%40ssw%3Ard@localhost:2113
kurrentdb://cluster:2113?userCertFile=/certs/user.crt&userKeyFile=/certs/user.key

In code, through a profile:

opts.Security = KurrentClientSecurityOptions.Password("admin", "changeit");
opts.Security = KurrentClientSecurityOptions.MutualTls(clientCertificate, rootCaCertificate);

The second overload takes loaded X509Certificate2 instances, for a certificate that comes from a store or a secrets manager rather than a file.

A local node started in insecure mode speaks plain HTTP/2. Say so, or the handshake fails.

kurrentdb://localhost:2113?tls=false
opts.Security = KurrentClientSecurityOptions.Insecure;

The three TLS parameters combine into one transport mode.

tls tlsCaFile tlsVerifyCert Result
false any any No transport security
true set any Verify against that CA bundle
true unset true Verify against the system trust store
true unset false Encrypted, not verified

Credentials belong to the client, and no operation takes its own. An application that must act as more than one identity builds a client per identity.