Table of Contents

Property Mode

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

Mode

TLS mode to use during connection.

public TlsMode Mode { get; init; }

Property Value

TlsMode

Remarks

Defaults to Auto, which resolves to Prefer for nats:// connections without certificates. In this mode the client will attempt a TLS upgrade when the server advertises TLS support. This differs from most other NATS clients, which do not upgrade unless explicitly configured.

Behind a TLS-terminating proxy, use Disable to prevent the client from attempting a TLS upgrade that the nats-server cannot complete. Use the tls:// scheme or Require when TLS is required.

Only Require and Implicit provide the full protection that TLS can offer. Other modes may fall back to plaintext depending on server configuration.