Skip to content

[7.5] Backport #4495: Enforce hostname verification by default for TLS connections#4497

Merged
ggivo merged 5 commits into
7.5.xfrom
topic/ggivo/backport-4495-7.5
Apr 24, 2026
Merged

[7.5] Backport #4495: Enforce hostname verification by default for TLS connections#4497
ggivo merged 5 commits into
7.5.xfrom
topic/ggivo/backport-4495-7.5

Conversation

@ggivo

@ggivo ggivo commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Backport of #4495 to 7.5.

Enables HTTPS endpoint identification by default in DefaultJedisSocketFactory
when ssl(true) is used without custom SSLParameters, closing the hostname
verification bypass. Deprecates the low-level SSL config methods
(getSslSocketFactory, getSslParameters, and the corresponding builder
setters) in favor of SslOptions, and adds SslOptions.defaults() as a
one-line migration from ssl(true).

See #4495 for behavior change and fallback options.

Fixes: CAE-2794


Note

High Risk
Behavior changes in TLS socket creation now enforce HTTPS endpoint identification by default, which can break existing deployments that relied on connecting via IP/incorrect hostnames. Changes touch connection security defaults and related config APIs.

Overview
TLS connections created via legacy ssl(true) now enable hostname verification by default by applying SSLParameters with HTTPS endpoint identification in DefaultJedisSocketFactory when callers don’t supply custom parameters.

Legacy low-level SSL configuration (getSslSocketFactory, getSslParameters, and the corresponding DefaultJedisClientConfig.Builder setters including ssl(boolean)) is deprecated in favor of SslOptions, and SslOptions.defaults() is added as a one-line migration path.

Integration tests and test fixtures are updated to cover hostname-mismatch failures across standalone, RedisClient, cluster, and sentinel TLS setups, including explicit opt-out via custom SSLParameters, plus new *-wronghost endpoints and sentinel config tweaks to use hostnames.

Reviewed by Cursor Bugbot for commit 8d91535. Bugbot is set up for automated code reviews on this repo. Configure here.

ggivo added 5 commits April 24, 2026 11:03
Enable HTTPS endpoint identification algorithm by default in DefaultJedisSocketFactory
when ssl(true) is used without custom SSLParameters.
Add tests (Jedis, RedisClient, RedisClusterClient, RedisSentinelClient) to
verify hostname verification failure when certificate CN/SAN doesn't match the
connection hostname.

Users can still override by providing custom SSLParameters.

Fixes: CAE-2794
…ters config

Mark legacy SSL configuration (ssl, sslSocketFactory, sslParameters getters and
builder setters) as @deprecated since 7.4.2 in favor of SslOptions, and update
JedisClientConfig / SslOptions Javadoc.
@jit-ci

jit-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@github-actions

github-actions Bot commented Apr 24, 2026

Copy link
Copy Markdown

Test Results

   302 files  ± 0     302 suites  ±0   12m 1s ⏱️ +21s
10 941 tests +14  10 885 ✅ +419  56 💤  - 405  0 ❌ ±0 
 5 656 runs  +20   5 647 ✅ +165   9 💤  - 145  0 ❌ ±0 

Results for commit 8d91535. ± Comparison against base commit 43dec3b.

♻️ This comment has been updated with latest results.

@ggivo ggivo merged commit 028bfee into 7.5.x Apr 24, 2026
13 checks passed
@ggivo ggivo deleted the topic/ggivo/backport-4495-7.5 branch April 24, 2026 10:45
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.

1 participant