Re: [PR] Add TLS/TLCP SSL support to the C++ client with bundled Tongsuo [iotdb]

2026-07-07 Thread via GitHub


hongzhi-gao closed pull request #18130: Add TLS/TLCP SSL support to the C++ 
client with bundled Tongsuo
URL: https://github.com/apache/iotdb/pull/18130


-- 
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]



Re: [PR] Add TLS/TLCP SSL support to the C++ client with bundled Tongsuo [iotdb]

2026-07-06 Thread via GitHub


HTHou commented on PR #18130:
URL: https://github.com/apache/iotdb/pull/18130#issuecomment-4900918774

   One more API/UX note about the new `trustStore` / `keyStore` naming:
   
   It is reasonable to align the C++ Session API with the Java Session API, but 
in the C/C++ ecosystem this naming can be ambiguous. Some C/C++ clients use 
similar names, but often with different semantics. For example, Paho MQTT C has 
`trustStore` / `keyStore` fields but they point to PEM files, while librdkafka 
supports a PKCS#12 `ssl.keystore.location` for client authentication but still 
uses CA-style options such as `ssl.ca.location` / `ssl.ca.pem` for server 
trust. Many C++ APIs instead expose OpenSSL-style inputs directly (`ca/root 
certs`, `cert chain`, `private key`).
   
   So if this PR keeps the Java-style names, please make the boundary explicit 
in docs and errors: JKS is not supported by the C++ client; `.p12` / `.pfx` 
means PKCS#12, and PEM trust files are only supported through the 
legacy/path-style option. It may also be useful to keep or add OpenSSL-style 
configuration names (`caFile`, `certFile`, `keyFile`, etc.) so native C++ users 
do not have to think in Java keystore terms when they already have PEM material.


-- 
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]



Re: [PR] Add TLS/TLCP SSL support to the C++ client with bundled Tongsuo [iotdb]

2026-07-06 Thread via GitHub


HTHou commented on PR #18130:
URL: https://github.com/apache/iotdb/pull/18130#issuecomment-4900823518

   I reviewed this PR locally against head 
`696ca4872a2a5c03635048a8a990c49b7e1d54b5`. I think there are a few issues 
worth addressing before merge:
   
   1. `trustStore` does not actually enable server certificate verification in 
the Thrift socket path.
   
  `RpcSslUtils::createTlsClientContext()` / `createTlcpClientContext()` 
load the trust store and set `SSL_VERIFY_PEER`, but 
`RpcSslUtils::createSslSocketFactory()` then calls 
`factory->authenticate(false)`. In Thrift 
`TSSLSocketFactory::authenticate(false)` resets the context verify mode to 
`SSL_VERIFY_NONE`, so the configured trust store is effectively bypassed for 
normal `Session` / `ThriftConnection` connections. This means the documented 
TLS one-way/server-authentication and TLCP trust-store behavior is not 
enforced. The current handshake tests use `SSL_connect` directly, so they do 
not cover this Thrift socket factory path.
   
  Could we make this conditional, for example call `authenticate(true)` 
when `config.effectiveTrustStore()` is set and keep `authenticate(false)` only 
for the legacy no-trust-store mode? It would also be good to add a 
Session/Thrift-level negative test where a wrong CA must fail.
   
   2. The bundled Tongsuo source is not pinned to an immutable artifact.
   
  `TONGSUO_GIT_REF` defaults to `8.4-stable`, and `FetchOpenSSL.cmake` 
downloads the branch tarball without an expected hash. Since that branch can 
move, the same IoTDB commit can produce different SDK binaries over time, which 
is risky for release reproducibility and dependency auditing. Please consider 
pinning a tag/commit and verifying the tarball hash.
   
   3. The packaged SDK examples are inconsistent with the updated examples 
README.
   
  `examples/README.md` documents `cpp_tls_example`, `cpp_ntls_example`, 
`tls_tree_example`, and `c_ntls_example`, but `src/assembly/client-cpp.xml` 
only packages the older example sources. Also, `examples/CMakeLists.txt` only 
creates the new TLS/TLCP example targets in the in-tree build path. After users 
unpack the released SDK zip, the documented TLS/TLCP examples are not 
available/buildable from the package.
   
   4. Architectural question: should Tongsuo be the default SSL provider for 
all C++ SDK builds?
   
  Since most users only need standard TLS, would it be possible to keep the 
default SDK on upstream OpenSSL and provide a Tongsuo/TLCP-specific build 
flavor only when TLCP is requested? For example, an explicit provider 
option/classifier such as `IOTDB_SSL_PROVIDER=TONGSUO` or a separate TLCP 
package could keep the default TLS path simpler, reduce the default 
dependency/build-toolchain surface, and limit the impact of Tongsuo to users 
who actually need TLCP.


-- 
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]