gnodet-bot commented on code in PR #30891:
URL: https://github.com/apache/camel/pull/30891#discussion_r4713070387


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -642,6 +642,22 @@ all `https://` addresses.
 A route that called an `https://` address of a server that only speaks plain 
HTTP now fails; use an `http://` address
 for such a server. An `http://` address with `sslContextParameters` is not 
changed.
 
+=== camel-vertx, camel-platform-http-vertx, camel-kafka, camel-thrift - the 
named groups of sslContextParameters
+
+The Vert.x components (`camel-platform-http-vertx`, `camel-vertx-http` and 
`camel-vertx-websocket`) now apply the

Review Comment:
   **Missing component in the paragraph — `camel-vertx-mqtt`**
   
   The body paragraph lists three Vert.x components but omits 
`camel-vertx-mqtt`, which also calls `VertxHelper.setupSSLOptions()` and is 
affected by this change. The documentation table in 
`camel-configuration-utilities.adoc` correctly includes it.
   
   ```suggestion
   The Vert.x components (`camel-platform-http-vertx`, `camel-vertx-http`, 
`camel-vertx-websocket` and `camel-vertx-mqtt`) now apply the
   ```



##########
components/camel-vertx/camel-vertx-common/src/main/java/org/apache/camel/component/vertx/common/VertxHelper.java:
##########
@@ -127,9 +145,40 @@ public static void setupSSLOptions(
             if (protocols) {
                 tcpsslOptions.setEnabledSecureTransportProtocols(new 
LinkedHashSet<>(List.of(engine.getEnabledProtocols())));
             }
+            String[] groups = engine.getSSLParameters().getNamedGroups();
+            if ((namedGroups || postQuantum) && groups != null) {
+                // Vert.x applies its key exchange groups on each SSLEngine it 
creates, server and client side
+                sslOptions(tcpsslOptions).setKeyExchangeGroups(new 
ArrayList<>(List.of(groups)));
+            }
+        }
+
+        // Vert.x has no setting for the signature schemes
+        if (sslContextParameters.getSignatureSchemes() != null || 
sslContextParameters.getSignatureSchemesFilter() != null) {
+            LOG.warn("Vert.x cannot apply the signature schemes of 
sslContextParameters, as its TLS options have no such"
+                     + " setting: the signature schemes of the JVM are used 
instead");
         }
     }
 
+    /**
+     * The SSL options of the given TCP SSL options, which Vert.x creates on 
the first SSL setting.
+     */
+    private static SSLOptions sslOptions(TCPSSLOptions tcpsslOptions) {
+        SSLOptions answer = tcpsslOptions.getSslOptions();
+        if (answer == null) {
+            // setting a value creates them, so set the one they already have
+            
tcpsslOptions.setSslHandshakeTimeout(tcpsslOptions.getSslHandshakeTimeout());
+            answer = tcpsslOptions.getSslOptions();
+        }
+        return answer;
+    }

Review Comment:
   ⚠️ **Fragile side-effect hack — use the public API instead**
   
   The workaround calls `setSslHandshakeTimeout(getSslHandshakeTimeout())` as a 
no-op to trigger lazy initialization of `SSLOptions` inside Vert.x. This 
exploits undocumented internal behavior: it will silently break if Vert.x ever 
changes when it creates `SSLOptions`.
   
   `TCPSSLOptions` already has a public `getOrCreateSSLOptions()` method that 
does exactly this cleanly (confirmed in vertx-core-5.2.3 bytecode). The entire 
method collapses to a one-liner.
   
   ```suggestion
       private static SSLOptions sslOptions(TCPSSLOptions tcpsslOptions) {
           return tcpsslOptions.getOrCreateSSLOptions();
       }
   ```



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