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

   ## Summary
   
   `ThriftProducer.initializeSslTransport()` built its TLS connection from 
`TSSLTransportFactory.TSSLTransportParameters`, which only supports trust store 
configuration. It could not carry the **key managers** (client certificate), 
**named groups**, **signature schemes** or other SSL engine options from 
`sslContextParameters`. This made mTLS (client certificate authentication) 
impossible for the Thrift producer, while `ThriftConsumer` correctly used 
`SSLContextParameters.createSSLContext()` and worked fine.
   
   ## Root Cause
   
   `TSSLTransportFactory.TSSLTransportParameters` only exposes `setKeyStore()` 
and `setTrustStore()` for the server key and the client's trust anchors. It has 
no way to carry a client certificate (key managers) or any `SSLEngine`-level 
options. The producer called only `sslParams.setTrustStore()` and never touched 
the key managers, so a Thrift server that called `setNeedClientAuth(true)` 
would reject its TLS handshake.
   
   ## Fix
   
   Replace the `TSSLTransportFactory`-based path in `initializeSslTransport()` 
with `SSLContextParameters.createSSLContext(camelContext)`, which applies all 
SSL settings: key managers (client certificate), trust managers, protocols, 
cipher suites and named groups. The resulting `SSLSocket` is wrapped in a 
`TSocket(Socket)` — the same approach `ThriftConsumer.initializeServer()` has 
always used. Remove `logDroppedSslOptions()` and 
`ThriftProducerSslOptionsTest`, which documented and tested the limitation of 
the old approach.
   
   ## Tests
   
   `ThriftProducerClientAuthenticationTest` starts a Thrift server whose 
`SSLServerSocket` has `setNeedClientAuth(true)` and verifies that a Camel 
producer configured with both key managers and trust managers in 
`sslParameters` successfully authenticates and calls `calculate`. A producer 
without key managers would fail the TLS handshake and the test would throw an 
exception.
   
   Fixes CAMEL-27582
   
   ---
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


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