Repository navigation
fix(tls): replace SSL_OP_NO_TLSv1/1_1 with set_min_proto_version (OpenSSL 4.0 compat) - #432
Merged
Merged
Conversation
…nSSL 4.0 compat) SSL_OP_NO_TLSv1 and SSL_OP_NO_TLSv1_1 are absent from the OpenSSL 4.0 public API. PR #388 covered the threading/init deprecations but missed these two flags, so master would fail to build against OpenSSL 4.0. SSL_CTX_set_min_proto_version / SSL_CTX_set_max_proto_version are semantically equivalent (enforcing the user-requested protocol range) and are available since OpenSSL 1.1.0. SSL_OP_NO_TLSv1_2 (also removed in 4.0) is covered by the same guard. Falls back to SSL_OP_NO_TLSv* on pre-1.1.0 toolchains. Refs: 2.4 review finding #17 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ab076b0. Configure here.
Bugbot flagged that the min/max approach allowed intermediate protocols the user explicitly omitted (e.g. --tls-protocols "tlsv1,tlsv1.2" enabled tlsv1.1). Combines envelope clamp (set_min/max_proto_version) with per-gap SSL_OP_NO_TLSv1_x masks, guarded by #ifdef so OpenSSL 4.0 (which may remove the symbols entirely) still builds. For 4.0 the gap-mask is silently skipped: removing those symbols means the runtime can't individually disable them anyway, which matches OpenSSL's intended deprecation policy. Refs: bugbot MED review on PR #432 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Collaborator
Author
|
Bugbot MED addressed via 46eacec: now combines envelope clamp with per-gap SSL_OP_NO_TLSv1_x masks (guarded by #ifdef for OpenSSL 4.0 compat). Gap protocols are masked explicitly; OpenSSL 4.0 falls back to envelope-only since the per-version constants are slated for removal there too. |
fcostaoliveira
added a commit
to filipecosta90/memtier_benchmark
that referenced
this pull request
Jun 2, 2026
Resolve conflicts after redis#432/redis#434/redis#435 landed on master. Conflict in memtier_benchmark.cpp: adopt master's "must be a positive integer" wording (standardized by redis#432) for the four negative-value guard fprintf() calls added by this branch; both sides trigger on the same code path and the test assertions only check the prefix, so either wording is functionally correct.
3 tasks
fcostaoliveira
added a commit
that referenced
this pull request
Jun 2, 2026
PR #432 added gap-mask SSL_OP_NO_TLSv1_x #ifdef blocks so the build works on OpenSSL 4.0 (where those constants are slated for removal). But a user passing a non-contiguous bitmask (e.g. tlsv1,tlsv1.2) on OpenSSL 4.0 would silently get the intermediate version enabled inside the envelope, with no warning. Adds parser-time validation: on OpenSSL >= 4.0 a non-contiguous bitmask is rejected at startup with an actionable error. On OpenSSL <= 3.x the gap-mask logic still enforces the user's selection. Refs: 2.4 review #37 (Review 14 + PR #432 review R4). Co-authored-by: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
SSL_OP_NO_TLSv1,SSL_OP_NO_TLSv1_1, andSSL_OP_NO_TLSv1_2are absent from the OpenSSL 4.0 public API; master would fail to build against OpenSSL 4.0.OP_NO_TLSv*flags.SSL_CTX_set_options(SSL_OP_NO_TLSv*)calls withSSL_CTX_set_min_proto_version/SSL_CTX_set_max_proto_version, computed from the existingtls_protocolsbitmask — semantically identical behaviour.SSL_OP_NO_TLSv*fallback path.>= 0x10101000L) is preserved inside the new block.Refs: 2.4 release review finding #17.
Test plan
OP_NO_*logic.SSL_OP_NO_TLSv*symbols are no longer referenced, so the build succeeds.🤖 Generated with Claude Code
Note
Medium Risk
TLS handshake version/cipher negotiation behavior changes on OpenSSL 1.1+ (intended to match prior OP_NO_* semantics); gap-protocol edge cases deserve TLS integration tests. CLI changes are low-risk input validation only.
Overview
OpenSSL 4.0 / TLS: For OpenSSL ≥ 1.1.0, protocol selection no longer relies only on
SSL_OP_NO_TLSv1*(removed in OpenSSL 4.0). The PR setsSSL_CTX_set_min_proto_version/set_max_proto_versionfrom the existingtls_protocolsbitmask, then disables gap versions inside that range withSSL_OP_NO_TLSv*only when those macros exist (#ifdefper version). OpenSSL < 1.1.0 keeps the previousSSL_OP_NO_TLSv*path.CLI validation:
--requests,--clients,--threads, and--test-timenow reject leading-negative values viaoptarg_is_negative, reseterrnobeforestrtoul/strtoull, and treatERANGEas parse errors—avoiding silent huge unsigned values from negative input.Reviewed by Cursor Bugbot for commit 46eacec. Bugbot is set up for automated code reviews on this repo. Configure here.