Repository navigation
CAMEL-25964: camel-vertx - VertxHelper does not apply standalone TrustManager from SSLContextParameters - #28305
Conversation
…tManager from SSLContextParameters When configuring TLS through SSLContextParameters with a standalone TrustManager instance (via TrustManagersParameters.setTrustManager), VertxHelper should wrap and apply the configured TrustManager using TrustOptions.wrap(trustManager). When no standalone TrustManager is supplied, createTrustManagerFactory continues to configure TrustManagerFactoryOptions from the configured keystore. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
🔄 Backport BotThis bugfix targets
Add a Backport PRs will be created automatically on merge (once a port label is added). Comment ℹ️ If you push additional commits after |
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 26 of 707 tested, 2 compile-only — current: 26 all testedMaveniverse Scalpel detected 26 affected modules (current approach: 26). Skip-tests mode would test 26 modules (2 direct + 0 downstream), skip tests for 2 (generated code, meta-modules) Modules Scalpel would test (26)
Modules with tests skipped (2)
Build reactor — dependencies compiled but only changed modules were tested (2 modules, 17.3s total)Total reactor time: 17.3s
Top 20 slowest modules:
|
davsclaus
left a comment
There was a problem hiding this comment.
TL;DR
Comment — a correct, focused fix: VertxHelper now applies any standalone TrustManager set on TrustManagersParameters, not only TrustAllTrustManager.INSTANCE. That gives it the same precedence as TrustManagersParameters.createTrustManagers() in core (a standalone TrustManager wins over the keystore). Ready to merge; the points below are follow-ups.
Blockers
- None
Other findings: 1 non-blocking, 2 suggestions — see below.
Non-blocking
- Backport labels and the LTS upgrade-guide entries. CAMEL-25964 has fixVersions 4.24.0, 4.22.3 and 4.18.6, and
camel-4.22.xandcamel-4.18.xhave the same== TrustAllTrustManager.INSTANCEcheck. The PR has noport/camel-4.22.x/port/camel-4.18.xlabels, and the upgrade-guide note is only incamel-4x-upgrade-guide-4_24.adoc. Per the backport upgrade-guide policy in.oss-ai-helper-rules/project-guidelines.md, the same note belongs in the "Upgrading from 4.22.2 to 4.22.3" section ofcamel-4x-upgrade-guide-4_22.adocand the "Upgrading from 4.18.5 to 4.18.6" section ofcamel-4x-upgrade-guide-4_18.adoconmain.
Suggestions (inline)
VertxHelperTest: the standalone and trust-all tests only check that some trust options are set; they can check that the configuredTrustManageris the one Vert.x will use.- Upgrade guide: one more sentence for the case where both a
TrustManagerand a keystore are set.
A note for other reviewers: VertxHelper.java shows as rewritten because the file had CRLF line endings on main and is LF now; with whitespace ignored the change is 10 added and 9 removed lines.
This review covers the project's rules and conventions; it does not replace specialized review tools or static analysis.
Claude Code on behalf of @davsclaus
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
…ert.x applies, and document the TrustManager-over-keystore case VertxHelperTest now checks that the TrustManager wrapped into the Vert.x trust options is the configured one (the standalone manager, and TrustAllTrustManager.INSTANCE), instead of only that some trust options are set. The upgrade-guide note says that a standalone TrustManager now wins over a keystore configured on the same TrustManagersParameters, as it does in the other components that use SSLContextParameters. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
|
Pushed one more commit for the review: "CAMEL-25964: Address review feedback - assert the TrustManager that Vert.x applies, and document the TrustManager-over-keystore case".
Claude Code on behalf of oscerd |
davsclaus
left a comment
There was a problem hiding this comment.
Thanks Andrea, the new commit addresses the review:
VertxHelperTestnow checks that the configuredTrustManageris the one Vert.x uses, for the custom manager and forTrustAllTrustManager.INSTANCE. In Vert.x 5.2.1,TrustOptions.wrap(tm)builds aTrustManagerFactoryWrapperwhosegetTrustManagers()returns the wrapped manager, so the assertions test the fix (they fail onmain, where a custom manager is not applied).- The upgrade guide covers the case where both a
TrustManagerand a keystore are set. This matches the code:setupSSLOptionschecksgetTrustManager()first.
On the backports: doing the 4.22.3 / 4.18.6 upgrade-guide notes on main together with the ports is fine (the policy allows a follow-up doc-sync). If the port/camel-4.22.x and port/camel-4.18.x labels are added before merging, the backport bot opens the port PRs on merge.
LGTM once CI is green.
Claude Code on behalf of @davsclaus. This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
|
/port |
🔄 Backport BotConflicts (🤖 agent dispatched to resolve):
ℹ️ If you push additional commits after |
|
✅ Backport to |
|
✅ Backport to |
Jira: https://issues.apache.org/jira/browse/CAMEL-25964
Problem
In
VertxHelper.setupSSLOptions(...)(camel-vertx-common), Vert.xTCPSSLOptionsare configured fromSSLContextParameters.When
TrustManagersParametersis configured with a standaloneTrustManagerviasetTrustManager(...)without aKeyStore,createTrustManagerFactory(...)returnsnullbecause no keystore is present.VertxHelperpreviously checked only whether:Any other standalone
TrustManagerinstance was discarded and not passed totcpsslOptions.setTrustOptions(...). As a result,tcpsslOptions.getTrustOptions()remainednull, and Vert.x fell back to its default trust configuration.Change
org.apache.camel.component.vertx.common.VertxHelper: Check whethersslContextParameters.getTrustManagers() != null && sslContextParameters.getTrustManagers().getTrustManager() != null. If present, wrap and set it usingTrustOptions.wrap(trustManager). When no standaloneTrustManageris supplied, callcreateTrustManagerFactory(camelContext, sslContextParameters)to configureTrustManagerFactoryOptionsfrom the configured keystore.TrustManagerinstances onSSLContextParametersare now applied in Vert.x components.Tests
VertxHelperTestincamel-vertx-commonto test:TrustManageris wrapped and applied.TrustAllTrustManager.INSTANCEis wrapped and applied.TrustManagerFactoryis applied when no standalone manager is set.Claude Code on behalf of oscerd
🤖 Generated with Claude Code