Fix rfc2818_verification build failure on Windows with Boost 1.83.0 and OpenSSL 3.x [HZ-5424]#1464
Open
ihsandemir wants to merge 1 commit into
Open
Conversation
…nd OpenSSL 3.x [HZ-5424] Boost 1.83.0's umbrella <boost/asio/ssl.hpp> transitively includes <boost/asio/ssl/rfc2818_verification.hpp>. In Boost.Asio's default header-only mode that pulls in rfc2818_verification.ipp, whose hostname-matching code dereferences ASN1_STRING fields directly (domain->data, domain->length). OpenSSL 3.x made ASN1_STRING opaque and MSVC rejects the field accesses, breaking the Windows build with errors C2027 (use of undefined type 'asn1_string_st') and C2660 (memcmp argument list mismatch). The client never uses rfc2818_verification; it uses the modern host_name_verification instead (see util.cpp). Replace the umbrella <boost/asio/ssl.hpp> include with the specific subheaders we actually need in the three internal socket headers that pulled it in. This sidesteps rfc2818_verification.hpp entirely and matches the include pattern already used in util.cpp. Boost removed rfc2818_verification from <boost/asio/ssl.hpp> after 1.83.0, which is why the Boost 1.90.0 matrix entry was unaffected.
JackPGreen
reviewed
May 22, 2026
| #include <boost/lockfree/queue.hpp> | ||
| #ifdef HZ_BUILD_WITH_SSL | ||
| #include <boost/asio/ssl.hpp> | ||
| // Avoid <boost/asio/ssl.hpp> because in Boost <= 1.83 it transitively |
Contributor
There was a problem hiding this comment.
Could we bump the min supported boost version instead?
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.
Closes #1463
Summary
nightly-Windowsworkflow fails to compilerfc2818_verification.ipp:error C2027: use of undefined type 'asn1_string_st'(followed by a cascadingC2660onmemcmp).boost::asio::ssl::rfc2818_verification; it uses the modernhost_name_verification(hazelcast/src/hazelcast/util/util.cpp). The broken.ippwas being dragged in transitively through the umbrella<boost/asio/ssl.hpp>include in three internal socket headers.BaseSocket.h,SSLSocket.h, andSocketFactory.hwith the specific subheaders the codebase actually uses (context.hpp,error.hpp,host_name_verification.hpp,stream.hpp) — matching the include pattern already used inutil.cpp. This avoidsrfc2818_verification.hppentirely.Root cause
In Boost 1.83.0,
<boost/asio/ssl.hpp>lists<boost/asio/ssl/rfc2818_verification.hpp>among its includes. In Boost.Asio's default header-only mode that pulls inrfc2818_verification.ipp, whose hostname-matching code dereferencesASN1_STRINGfields directly (domain->data,domain->length). OpenSSL 3.0 madeASN1_STRINGan opaque type whose layout is no longer exposed by the public headers, so MSVC refuses to compile the field accesses (henceC2027; theC2660is a follow-on becausedomain->datacollapses to a non-pointer expression). GCC/Clang on Linux/macOS happen to accept the opaque-struct dereference more leniently on this path, which is why only the Windows + MSVC + OpenSSL 3.x combination breaks.Upstream Boost dropped
rfc2818_verificationfrom<boost/asio/ssl.hpp>after 1.83.0; it is no longer present in 1.90.0. That is why only the 1.83.0 matrix entry is affected.Test plan
hazelcast-cpp-clientlibrary withHZ_BUILD_WITH_SSL=ONsucceeds on macOS arm64 (vcpkg toolchain, Boost 1.90.0, OpenSSL 3.x).client_testbinary withHZ_BUILD_WITH_SSL=ONsucceeds (allboost::asio::ssl::context/verify_peer/verify_callbackuses in test files compile cleanly).nightly-Windowsworkflow withmsvc-latest_boost_1830+with_openssl: ONnow compiles (verified by re-running the workflow on this branch).nightly-Windowsworkflow withmsvc-latest_boost_1900+with_openssl: ONstill compiles (no regression).build-prWindows / Ubuntu / macOS matrices remain green.Tracking: HZ-5424