davsclaus opened a new pull request, #31029: URL: https://github.com/apache/camel/pull/31029
JIRA: https://issues.apache.org/jira/browse/CAMEL-27666 ## What was wrong `BonitaAPIConfig.getBaseBonitaURI()` always built an `http://` URI, and no option of the bonita endpoint selected HTTPS. So the producer could only talk to Bonita over plain HTTP: the username and password of the `loginservice` call, the session cookies and the `X-Bonita-API-Token` header were sent in clear text, and a Bonita server that only accepts HTTPS could not be reached. ## What changed - New endpoint option `protocol` (`http` or `https`, case-insensitive, default `http`, so existing routes are unchanged). Any other value fails the start of the producer with a clear message. - New endpoint option `sslContextParameters` (label `security`) and the component option `useGlobalSslContextParameters`. With `https`, the SSL context is set on all the JAX-RS clients of the producer: the client of the REST calls and file uploads, and the client of each login in `BonitaAuthFilter`. Without it, the default SSL context of the JVM is used. With `http` it is not used. - `BonitaAPIConfig` has `protocol`, `sslContext` and `newClient()`, which every place that created a client with `ClientBuilder.newBuilder().build()` now uses (producer, login filter, `BonitaAPIBuilder.build(config)`, the deprecated `BonitaAPIUtil.getInstance`). ## Tests - `BonitaHttpsTest` (new, 5 tests): a WireMock server that only accepts HTTPS, with a certificate the JVM does not trust (`jsse/localhost.p12`, copied from camel-smpp, valid until 2056, DNS:localhost): - startCase succeeds with `protocol=https&sslContextParameters=#ssl` (both logins and the instantiation go over HTTPS); - `protocol=HTTPS` works too; - the global SSL context parameters are used with `useGlobalSslContextParameters=true`; - without the SSL context the login fails with an `SSLException`, which shows that the SSL context of the endpoint is what reaches the clients; - `protocol=ftp` fails the route start. - `BonitaAPIConfigTest`: 3 new tests for the https base URI, case and null handling, and the refused protocol. - All 45 tests of the module pass. Before the fix the new tests do not compile (no `protocol`/`sslContextParameters`/`useGlobalSslContextParameters` API). ## Docs New "Using HTTPS" section in `bonita-component.adoc` (and the catalog copy). Component JSON, catalog JSON, endpoint DSL and component DSL regenerated. No upgrade-guide entry, as the default stays `http`. Note: #30999 (CAMEL-27611) also changes `BonitaAPIConfig.getBaseBonitaURI()` (base path) and the generated files, so whichever merges second needs a small rebase. _Claude Code on behalf of Claus Ibsen_ 🤖 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]
