Skip to content

Reject inverted protocol version range in SSLContext - #142

Merged
SeanTAllen merged 1 commit into
mainfrom
fix-inverted-proto-version-range
Aug 2, 2026
Merged

Reject inverted protocol version range in SSLContext#142
SeanTAllen merged 1 commit into
mainfrom
fix-inverted-proto-version-range

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

set_min_proto_version and set_max_proto_version accepted an inverted range — min above max — without raising. OpenSSL validates each boundary individually but does not cross-check them, so the call succeeded and every session from that context failed its handshake with "no protocols available."

Both setters now compare the new value against the existing opposite boundary before calling SSL_CTX_ctrl. SSLAutoVersion (0) bypasses the check, since a zero boundary means the library picks.

Closes #129

OpenSSL validates each boundary individually but does not cross-check
min against max. A caller could set min above max without raising,
producing a context where every session fails its handshake.

Both setters now compare the new value against the existing opposite
boundary before calling SSL_CTX_ctrl, so the context is never left
with an inverted range. SSLAutoVersion (0) bypasses the check, since
a zero boundary means the library picks.

Closes #129
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Aug 2, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Aug 2, 2026
@SeanTAllen
SeanTAllen merged commit 39fb751 into main Aug 2, 2026
16 checks passed
@SeanTAllen
SeanTAllen deleted the fix-inverted-proto-version-range branch August 2, 2026 03:12
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Aug 2, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 2, 2026
@SeanTAllen SeanTAllen mentioned this pull request Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSLContext accepts a protocol version range no handshake can use

2 participants