rahmjan opened a new issue, #555:
URL: https://github.com/apache/pekko-persistence-r2dbc/issues/555

   The drivers are `provided` dependencies of `pekko-persistence-r2dbc`, so an 
application only has the driver of its database. `ConnectionFactoryProvider` 
sets the PostgreSQL driver's options for every driver, through 
`PostgresqlConnectionFactoryProvider` and `SSLMode`:
   
   ```scala
   builder
     .option(PostgresqlConnectionFactoryProvider.FORCE_BINARY, 
java.lang.Boolean.TRUE)
     .option(PostgresqlConnectionFactoryProvider.PREFER_ATTACHED_BUFFERS, 
java.lang.Boolean.TRUE)
     ...
   builder.option(PostgresqlConnectionFactoryProvider.SSL_MODE, 
SSLMode.fromValue(settings.sslMode))
   ```
   
   This causes the following problems.
   
   1. An application with only `r2dbc-mysql` (or `r2dbc-mariadb`) on the 
classpath fails when it creates the connection factory:
   
      ```
      java.lang.NoClassDefFoundError: 
io/r2dbc/postgresql/PostgresqlConnectionFactoryProvider
      ```
   
      The workaround is to add `r2dbc-postgresql` as a dependency, even though 
it is never used.
   
   2. With `ssl.enabled = on`, MySQL's own SSL modes (`disabled`, `preferred`, 
`required`, `verify_ca`, `verify_identity`) fail in `SSLMode.fromValue`, which 
only knows PostgreSQL's modes.
   
   3. `ssl.root-cert` and `ssl.password` are passed as `sslRootCert` and 
`sslPassword`. The MySQL driver reads them as `sslCa` and `sslKeyPassword`, so 
it ignores them: the server certificate can't be verified with a custom root 
certificate, and an encrypted client key can't be used.
   
   **Reproduce:** use the `mysql` dialect with only `io.asyncer:r2dbc-mysql` on 
the classpath and start a journal, or run a MySQL connection factory with a 
class loader that doesn't have the PostgreSQL driver's classes.
   
   **Expected:** each driver only gets its own options, no driver needs another 
driver's classes, and the `ssl.*` settings reach the MySQL driver under the 
names it reads.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to