hongzhi-gao commented on PR #18601: URL: https://github.com/apache/iotdb/pull/18601#issuecomment-5611777216
> Thanks for splitting standard TLS/mTLS support into a separate PR and keeping OpenSSL as the default. I found two issues that I think should be addressed before merging: > > 1. **[P1] Make the macOS OpenSSL libraries relocatable.** > With source builds now enabled by default in [`FetchOpenSSL.cmake`](https://github.com/apache/iotdb/blob/f90b72280a4b90b9df5def02dff52e1d40bf90b6/iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake#L42), OpenSSL's [Darwin build rules](https://github.com/openssl/openssl/blob/openssl-3.5.8/Configurations/shared-info.pl#L46-L50) embed an absolute install name under the build directory's `_deps/openssl/install/lib/`. The packaging code copies the dylibs but does not rewrite their install names or dependent-library references. Setting `@loader_path` as an RPATH on `iotdb_session` does not resolve absolute library references. As a result, tests on the build machine can pass while the extracted SDK fails to load on another machine with `Library not loaded`. > Could we make these references relative using `@rpath`/`@loader_path`, including the dependency from libssl to libcrypto, and test the extracted SDK with the original OpenSSL build/install directory unavailable? > 2. **[P2] Propagate changes from `setSslConfig()` to node discovery.** > [`Session::setSslConfig()`](https://github.com/apache/iotdb/blob/f90b72280a4b90b9df5def02dff52e1d40bf90b6/iotdb-client/client-cpp/src/session/Session.cpp#L648) only updates `impl_->sslConfig_`. However, the Session constructor has already created and started a `NodesSupplier`, which holds its own copy of the previous SSL configuration. With the new C API sequence `ts_session_new()` -> `ts_session_set_ssl_config()` -> `ts_session_open()`, the main connection uses TLS, but background node discovery continues attempting plaintext connections. Discovery therefore fails against a TLS-only server, leaving the endpoint list stale and preventing failover to newly added nodes that were not in the initial list. > Could we defer starting node discovery until `open()`, or safely recreate it when the SSL configuration changes? A TLS/mTLS test that verifies endpoint discovery and failover would cover this path; the current single-node `SHOW VERSION` tests do not. > > These findings are based on static review of `f90b7228`; I have not run a full build or the integration tests locally. Thanks for the review. Both original findings are addressed: Darwin OpenSSL IDs and dependencies are rewritten to @rpath and the package smoke test hides the original install directory; NodesSupplier initialization is deferred until open() so it receives the final SSL configuration. The follow-up fixes and coverage are summarized in the inline replies. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
