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

   CAMEL-26546: the transports with a TLS stack of their own apply or report 
the named groups and signature schemes of sslContextParameters
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-26546
   
   This implements the scope that Andrea Cosentino (oscerd) described on the 
ticket (comment of 2026-11-03), with the two
   additions of the ticket comment of 2026-11-26: Vert.x now honours the named 
groups instead of only warning, and camel-netty uses the
   shared ordering logic of CAMEL-26545.
   
   ## Problem
   
   `SSLContextParameters` prefers the hybrid post-quantum named groups 
(CAMEL-23154), and the security guide said this
   applies to *all* `SSLContextParameters`. It only applies to components that 
use the `SSLContext` of
   `createSSLContext()`. Components that hand the key and trust material to a 
TLS stack of their own dropped
   `namedGroups` and `signatureSchemes` without a word: camel-kafka / 
camel-kafka-share (`KafkaClientConfiguration`),
   camel-vertx-common (`VertxHelper.setupSSLOptions`, used by 
platform-http-vertx, vertx-http, vertx-websocket and
   vertx-mqtt) and the camel-thrift producer. camel-netty had a private copy of 
the PQC ordering logic.
   
   ## Change
   
   - **camel-api**: new `JsseParametersHelper` (`@since 4.24`) in 
`org.apache.camel.support.jsse`:
     - `engineOnlyParameters(SSLContextParameters)`: the configured options 
that only the `SSLContext` applies
       (`namedGroups`, `namedGroupsFilter`, `signatureSchemes`, 
`signatureSchemesFilter`);
     - `postQuantumNamedGroups(SSLContextParameters)`: the PQC order 
`createSSLContext()` would apply on this JVM when no
       named groups are configured (`null` when configured, or when the JVM 
offers no hybrid or already leads with one);
     - `postQuantumNamedGroups(String[])`: the pure ordering function of 
CAMEL-26545, now public.
   - **camel-vertx-common**: Vert.x 5.2 has `SSLOptions.setKeyExchangeGroups`, 
applied by Vert.x to every `SSLEngine` it
     creates (server: `NetServerImpl`, client: `ChannelProvider`). 
`setupSSLOptions` now sets the named groups that the
     Camel `SSLContext` computes (configured, or the PQC preference on a JDK 
engine). Vert.x has no signature scheme
     setting: a `WARN` says so when they are configured.
   - **camel-kafka-common**: a `WARN` once per endpoint configuration when 
named groups / signature schemes are
     configured; the lost PQC preference (not a user setting) only at `DEBUG`.
   - **camel-thrift** producer: a `WARN` at start when named groups / signature 
schemes are configured; PQC at `DEBUG`.
   - **camel-netty**: `SSLEngineFactory.applyPqcNamedGroups` uses the shared 
function; the reflection for JDK < 20 is gone
     (Java 21 minimum).
   - Docs: `security.adoc` no longer claims "all SSLContextParameters"; 
`camel-configuration-utilities.adoc` has a new
     "Components with their own TLS stack" table stating per transport what is 
honoured, and the JVM-wide workaround
     (`jdk.tls.namedGroups`, `jdk.tls.client/server.SignatureSchemes`); short 
notes in the kafka, vertx-http,
     vertx-websocket and thrift pages (catalog copies updated); 4.24 upgrade 
guide entry.
   
   ### Why WARN for configured options and DEBUG for the PQC preference
   
   A configured `namedGroups` / `signatureSchemes` that is not applied is a 
misconfiguration the user must know about. The
   PQC preference is something Camel adds by itself; a Kafka client without it 
behaves like every plain Java Kafka client
   and uses the order of the JVM (which on JDK 27 already leads with 
`X25519MLKEM768`). A WARN for every Kafka endpoint
   with `sslContextParameters` would be noise, so it is a DEBUG message.
   
   ### What was checked and left as a follow-up
   
   - **Vert.x signature schemes**: the only hook would be a custom 
`JdkSSLEngineOptions`/`SslContextFactory` wrapping the
     Netty `SslContext`; that replaces Vert.x's engine selection (OpenSSL, 
ALPN) and is not contained, so WARN only.
   - **Kafka 4.4**: no `ssl.*` property carries named groups or signature 
schemes. `ssl.engine.factory.class` takes a
     pluggable `SslEngineFactory`, and `ChannelBuilders.channelBuilderConfigs` 
passes unknown configs down, so a Camel
     factory could use the decorated `SSLContext`. It would replace Kafka's 
`DefaultSslEngineFactory` (the `ssl.keystore.*`
     / `ssl.truststore.*` options and `additionalProperties` would no longer 
apply when `sslContextParameters` is set,
     plus `keystore()`/`truststore()`/`shouldBeRebuilt` semantics): a bigger 
change, left as a follow-up.
   - **Thrift producer**: it could use the decorated `SSLContext` like the 
consumer (CAMEL-25461). That also changes how a
     bare trust store path is resolved (Thrift: file first; Camel: classpath) 
and starts sending the client certificate of
     the key managers, which the producer drops today. Left as a follow-up.
   
   ### Behaviour change in camel-netty
   
   Only for orders that the old copy got wrong, the same way CAMEL-26545 fixed 
`SSLContextParameters`: an order that
   already leads with a hybrid (for example a CNSA 2.0 order set through 
`jdk.tls.namedGroups`) is kept, and the NIST
   hybrids `SecP256r1MLKEM768` / `SecP384r1MLKEM1024` count as post-quantum 
groups. The default orders of the JDKs are
   unchanged.
   
   ## Tests
   
   - `JsseParametersHelperTest` (camel-core): option names, PQC ordering, and 
that the reported order is the one
     `createSSLContext()` applies.
   - `VertxHelperNamedGroupsTest` (camel-vertx-common): real TLS handshakes. A 
Vert.x `NetServer` configured with
     `secp256r1` rejects a JDK client that offers only `x25519` and accepts one 
offering `secp256r1`; a Vert.x `NetClient`
     configured with `x25519` fails against a JDK server with only `secp256r1` 
and connects to one with `x25519`; the
     signature scheme WARN. Fails on main: both handshakes that must fail 
succeed ("Expecting code to raise a throwable").
   - `KafkaClientConfigurationSslTest` (camel-kafka-common): one WARN for three 
property builds, one more for a copy, none
     without the options. Fails on main: no warning.
   - `ThriftProducerSslOptionsTest` (camel-thrift): one WARN at producer start, 
calls still work. Fails on main: no warning.
   - `SSLEngineFactoryTest` (camel-netty): the reordering of an order that does 
not lead with a hybrid (same result as the
     old code) and that an order leading with one is kept.
   - Module test suites, all green: camel-core 
`org.apache.camel.support.jsse.*Test` 78 (1 skipped), camel-kafka-common 13,
     camel-vertx-common 10, camel-thrift 77, camel-netty 192 (9 skipped), 
camel-netty-http 410 (10 skipped),
     camel-platform-http-vertx 182 (1 skipped), camel-vertx-http 129 (1 
skipped), camel-vertx-websocket 129,
     camel-vertx-mqtt 91.
   
   ## Upgrade notes
   
   New 4.24 upgrade guide entry: the Vert.x components now apply the configured 
named groups (a peer that supports none
   of them can no longer connect), and Kafka and the Thrift producer log a WARN 
for the options they cannot apply.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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