Skip to content

feat(config): add mTLS (mutual TLS) support #488

Description

@currantw

Describe the feature

Add mutual TLS (mTLS) support to the Valkey GLIDE C# client. mTLS enables two-way certificate authentication between the client and the Valkey server, where both parties present and verify certificates. This is already supported in other GLIDE language clients (Java, Python, Node.js) but is currently missing from the C# implementation.

Use Case

Secure enterprise deployments often require mTLS to ensure that only authorized clients can connect to database servers. Without mTLS support, C# users cannot:

  • Meet zero-trust network security requirements that mandate mutual authentication.
  • Deploy Valkey GLIDE C# in environments where server-only TLS is insufficient (e.g., regulated industries, multi-tenant cloud environments).
  • Achieve feature parity with other GLIDE language clients that already support mTLS.

Proposed Solution

Extend ConnectionConfiguration (or TlsOptions) to accept client certificate and key parameters for mTLS authentication. The implementation should:

  1. Add configuration options for client certificate (PEM or PFX) and private key.
  2. Pass the client credentials through to glide-core via the existing FFI layer.
  3. Support both file-path-based and in-memory certificate loading.
  4. Follow the same API patterns used by other GLIDE clients for consistency.

Reference implementations:

Acknowledgements

  • I may be able to implement this feature request
  • This feature might cause a breaking change

Related

  • Other GLIDE clients already support mTLS via glide-core
  • The Rust core (glide-core) already has mTLS plumbing available

Additional Information

  • The glide-core Rust layer already supports mTLS configuration, so the primary work is exposing this capability through the C# FFI boundary and public API.
  • This should be a non-breaking addition (new optional configuration parameters).
  • Integration tests will require a Valkey server configured with mTLS (client certificate verification enabled).

Metadata

Metadata

Assignees

Labels

coreCore library (`sources/Valkey.Glide/`)

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions