Skip to content

redis: add client certificate support for mTLS - #242

Merged
jhrozek merged 1 commit into
mainfrom
redis-mtls
Aug 19, 2026
Merged

redis: add client certificate support for mTLS#242
jhrozek merged 1 commit into
mainfrom
redis-mtls

Conversation

@jhrozek

@jhrozek jhrozek commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add PEM-backed client certificate and key fields for Redis/Valkey mTLS
  • validate incomplete or malformed client credential pairs without exposing credential data in errors
  • cover standalone mTLS, cluster and Sentinel construction, and invalid/mismatched credential cases

Verification

  • go test -race ./redis
  • task
  • task license-check

Fixes #240

Add PEM-backed ClientCert and ClientKey fields to TLSConfig so callers can connect to Redis or Valkey endpoints that require mutual TLS.

Reject incomplete credential pairs during configuration validation and direct TLS config construction. BuildTLSConfig loads valid pairs with tls.X509KeyPair and returns a fixed parsing error so credential material is never included in an error.

Cover standalone mTLS connections, malformed and mismatched pairs, and cluster and Sentinel construction paths without adding dependencies.

Fixes #240
@jhrozek
jhrozek merged commit e36eefe into main Aug 19, 2026
5 checks passed
@jhrozek
jhrozek deleted the redis-mtls branch August 19, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redis: TLSConfig cannot present a client certificate (no mTLS support)

3 participants