davsclaus opened a new pull request, #31387: URL: https://github.com/apache/camel/pull/31387
_Claude Code on behalf of Claus Ibsen_ JIRA: [CAMEL-28116](https://issues.apache.org/jira/browse/CAMEL-28116) ## What was wrong The `sslContextParameters` option of the box component and endpoint was stored in `BoxConfiguration`, but `BoxConnectionHelper` never read it. The Box API connections of all three authentication types, and the login page requests of `STANDARD_AUTHENTICATION`, used the default TLS settings of the JVM, so a trust store set with this option had no effect. ## What changed - `BoxConnectionHelper.createConnection` takes the `CamelContext` and creates the `SSLContext` from `sslContextParameters`. - Box API connections (`STANDARD_AUTHENTICATION`, `APP_USER_AUTHENTICATION`, `APP_ENTERPRISE_AUTHENTICATION`): the trust manager of the parameters is set with the SDK's `configureSslCertificatesValidation` before the first token request. For the two JWT types the connection is now built with the `BoxDeveloperEditionAPIConnection` constructor and `tryRestoreUsingAccessTokenCache()`, which is what the SDK's static factories do, so TLS can be configured in between. For standard authentication the authorization code is exchanged after TLS is configured. - Login page requests of `STANDARD_AUTHENTICATION` (jsoup): use the whole `SSLContext`. - The Box SDK only accepts a trust manager (its OkHttp client is not exposed at compile time), so key managers are used only by the login page requests; a WARN says so when they are set. - Invalid parameters (for example a missing trust store) fail the connection with a message that names `sslContextParameters`. - The option description says what it is used for; catalog and DSLs regenerated. - Upgrade guide 4.25: the option is now used. ## Tests New `BoxConnectionHelperSslContextParametersTest`, against an HTTPS server on localhost with a self-signed certificate generated by `keytool` in a `@TempDir` (port 0): - an SDK connection with the trust store from `sslContextParameters` calls the server; without it the call fails; - a jsoup login request with the `SSLContext` calls the server; - a missing trust store fails with a message naming `sslContextParameters`. `BoxSharedConnectionTest` and `BoxEventsConsumerTest` follow the new signature. All 15 unit tests of `camel-box-component` pass. 🤖 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]
