Skip to content

fix(rate-limiter): enable rustls tls12 so TLS 1.2 Redis connects#110

Open
gandhipratik203 wants to merge 1 commit into
mainfrom
fix/redis-tls12-feature
Open

fix(rate-limiter): enable rustls tls12 so TLS 1.2 Redis connects#110
gandhipratik203 wants to merge 1 commit into
mainfrom
fix/redis-tls12-feature

Conversation

@gandhipratik203

@gandhipratik203 gandhipratik203 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

cpex-rate-limiter's rustls dependency was pinned with default-features = false and only
["ring", "std"], so rustls compiled without TLS 1.2 (1.3-only); the redis crate's
tls-rustls feature does not enable it either. Redis that offers only TLS 1.2 (e.g. AWS
ElastiCache) then shares no protocol version with the client, so the handshake fails and
the plugin returns BACKEND_UNAVAILABLE, even though redis-py (OpenSSL) connects to the
same endpoint.

Fix

Add the tls12 feature to rustls so TLS 1.2 works while keeping 1.3. One-line change that
keeps rustls and the existing TLS config handling, with no OpenSSL. Bumps to 0.1.4 and
adds a regression test that fails to build if the feature is dropped.

Validated against a live AWS ElastiCache and through a rebuilt gateway image: the stock
build returns BACKEND_UNAVAILABLE, this build connects.

@gandhipratik203 gandhipratik203 force-pushed the fix/redis-tls12-feature branch 2 times, most recently from f1fed1f to b34dbe0 Compare June 15, 2026 12:33
@gandhipratik203 gandhipratik203 changed the title fix(rate-limiter): enable rustls tls12 so TLS 1.2 Redis (ElastiCache) connects fix(rate-limiter): enable rustls tls12 so TLS 1.2 Redis connects Jun 15, 2026

@lucarlig lucarlig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

rustls was pinned with default-features = false and only ["ring", "std"], which compiles it without TLS 1.2 (1.3-only); the redis crate's tls-rustls feature does not enable tls12 either. Managed Redis that offers only TLS 1.2 (e.g. AWS ElastiCache) then shares no protocol version with the client, so the handshake fails and the plugin returns BACKEND_UNAVAILABLE even though a redis-py (OpenSSL) client connects to the same endpoint.

Add the rustls "tls12" feature so TLS 1.2 works while keeping 1.3. Bump the package to 0.1.4 and add a regression test that fails to build if the feature is dropped.

Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
@gandhipratik203 gandhipratik203 force-pushed the fix/redis-tls12-feature branch from b34dbe0 to 79aaeb6 Compare June 15, 2026 14:17
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.

2 participants