davsclaus opened a new pull request, #31030:
URL: https://github.com/apache/camel/pull/31030

   JIRA: https://issues.apache.org/jira/browse/CAMEL-27682
   
   ## What was wrong
   
   `MilvusEndpoint.createClient()` built the `ConnectParam` of the Milvus SDK 
from `host`, `port`, `timeout` and `token` only. The gRPC connection to Milvus 
was therefore always plaintext, and the `token` (user name and password, or an 
API key) was sent in clear text. The only way to use TLS was to build a 
`MilvusClient` in Java and set it with `MilvusConfiguration.setClient()`.
   
   ## What changed
   
   - New endpoint options, label `security`, passed to `ConnectParam.Builder` 
of the Milvus SDK 2.6.28:
     - `secure` (default `false`): TLS with the certificate authorities of the 
JVM (`withSecure`).
     - `serverPemPath`: one-way TLS trusting the given server or CA certificate 
(`withServerPemPath`).
     - `serverName`: the name expected in the server certificate 
(`withServerName`). With `serverPemPath` it defaults to `host`, as the SDK 
always overrides the channel authority with it there.
     - `caPemPath`, `clientPemPath`, `clientKeyPath`: mutual TLS 
(`withCaPemPath`, `withClientPemPath`, `withClientKeyPath`).
   - The SDK silently ignores incomplete settings, so the producer now fails at 
startup with a clear message when only some of `caPemPath` / `clientPemPath` / 
`clientKeyPath` are set, when `serverPemPath` is combined with them, or when 
`serverName` is set without either.
   - The `ConnectParam` creation moved to a package-private 
`createConnectParam()` so it can be tested without a Milvus server.
   - The `token` option gets the `security` label (item 6 of CAMEL-27680; the 
other items of that ticket are not touched here).
   - `sslContextParameters` is not supported: the SDK reads PEM files and 
builds its own (shaded) Netty SSL context. The doc says so.
   
   The default stays plaintext, so nothing changes for existing routes, and 
there is no upgrade-guide entry.
   
   ## Tests
   
   `MilvusConnectParamTest` (10 tests, no Milvus server):
   - the options reach the `ConnectParam` (plaintext default, `secure`, 
`serverPemPath` with and without `serverName`, mutual TLS);
   - the three invalid combinations fail with a clear message;
   - the client connects to a local `ServerSocket` on port 0: by default the 
first bytes are the HTTP/2 preface (`PRI *`), with `secure=true` they are a TLS 
handshake record.
   
   Before the fix the test does not compile (the options and 
`createConnectParam()` do not exist; a URI with `secure=true` fails as an 
unknown option). All unit tests of the module pass.
   
   ## Docs and generated files
   
   New "TLS" section in `milvus-component.adoc` (and the catalog copy); 
regenerated component JSON (+ catalog copy), configurers, endpoint DSL and 
component DSL.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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

Reply via email to