Repository navigation
Fix ssl_ut wrong-TLS-version test on OpenSSL 4 - #594
Merged
Merged
Conversation
OpenSSL 4.0 removed SSLv3, so SSL_CTX_set_max_proto_version(SSL3_VERSION) now fails outright (with an empty error queue), producing "OpenSSL error: 0 : Unknown SSL error" instead of the expected "no protocols available". Use an impossible min/max protocol range (min TLS1.3 > max TLS1.2) which fails the same way on every OpenSSL version.
alex-clickhouse
approved these changes
Oct 21, 2026
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.
Problem
The scheduled macOS
build (ssl)job started failing on 2026-10-19:https://github.com/ClickHouse/clickhouse-cpp/actions/runs/39179361295/job/117828616117
Homebrew's
opensslformula moved fromopenssl@3 3.6.4toopenssl@4 4.0.3and OpenSSL 4.0 removed SSLv3 entirely ("Removed support for SSLv3").ssl_set_version_bound()now requiresversion > SSL3_VERSION, soSSL_CTX_set_max_proto_version(ctx, SSL3_VERSION)returns 0 without pushing anything onto the error queue.HANDLE_SSL_CTX_ERRORinclickhouse/base/sslsocket.cpptherefore throwsOpenSSL error: 0 : Unknown SSL errorbefore any connection is attempted (note the0 msruntime in the log). On OpenSSL 3 the bound is accepted andSSL_connectlater fails withSSL_R_NO_PROTOCOLS_AVAILABLE.Fix
Replace the SSLv3 ceiling with an impossible min/max window:
Both bounds are valid on OpenSSL 1.1.0+, 3.x and 4.x, so context setup succeeds;
ssl_get_min_max_version()then finds no enabled version andSSL_connectfails withno protocols availableon every version. Unlike e.g.SetMaxProtocolVersion(TLS1_VERSION), this does not depend on security level orno-tls1*build options. Test name and expected message are unchanged.