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

   JIRA: [CAMEL-27747](https://issues.apache.org/jira/browse/CAMEL-27747)
   
   `PgReplicationSlotEndpoint.newDbConnection()` built 
`jdbc:postgresql://host:port/db` with only the user, the password and the 
replication properties, so the default sslmode of the PostgreSQL JDBC driver 
(`prefer`) always applied. That means TLS when the server offers it, without 
checking the server certificate, and a plain connection otherwise.
   
   Changes:
   - New endpoint options (label `security`), passed to pgjdbc 42.7 as 
connection properties:
     - `sslMode`: `disable`, `allow`, `prefer`, `require`, `verify-ca` or 
`verify-full`.
     - `sslRootCert`: the root certificates for `verify-ca` / `verify-full`.
     - `sslCert`, `sslKey`, `sslPassword` (secret): a client certificate.
   - None of them is set by default, so the driver defaults apply as before and 
nothing changes for existing routes. An unknown `sslMode` fails when the 
endpoint is initialized, with the valid values in the message.
   - The connection properties are built in a package-private 
`createConnectionProperties()` that the test can check.
   - A TLS section on the doc page, with a `verify-full` example.
   - `PgReplicationSlotTlsTest`, which needs no database:
     - the options end up in the connection properties;
     - without them, no `ssl*` property is set;
     - an invalid `sslMode` fails.
     All 12 unit tests of the module pass.
   - Regenerated the component JSON, configurer, URI factory, the catalog 
copies and the endpoint DSL.
   
   `sslContextParameters` / `useGlobalSslContextParameters` are not added. 
pgjdbc creates its SSL socket factory from a class name (`sslfactory`, with a 
`Properties` or `String` constructor), and only string connection properties 
reach it, so a Camel `SSLContext` cannot be passed in cleanly.
   
   The bugs of CAMEL-27740 are not part of this PR.
   
   _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