[CONJ-763] Custom SocketFactory is unable to parse connection properties Created: 2020-02-26 Updated: 2020-03-18 Resolved: 2020-03-06 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | configuration |
| Affects Version/s: | None |
| Fix Version/s: | 2.6.0 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Vinicius C Caldeira Carvalho | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The current implementation of the Utils class (https://github.com/mariadb-corporation/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L124) makes it impossible for custom implementations of the SocketFactory to infer any information from the environment. An example is what the Google Cloud SQL connector (https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory) needs to do in order to rotate certificates of the connection. It can use connection string arguments such as `cloudSqlInstance` to fetch the correct values. The mysql driver and postgres driver all pass the properties down to the SocketFactory implementation, but not this driver. It would be nice to provide a way (maybe by trying a constructor with a Properties argument if that is present) This is blocking me from adding mariadb as a connector for the google cloud sql project. |
| Comments |
| Comment by Diego Dupin [ 2020-03-04 ] |
|
There can be a solution to provide custom SocketFactory configuration option. |
| Comment by Diego Dupin [ 2020-03-06 ] |
|
The patch provided enhance current situation, so is added to 2.6.0 version. |
| Comment by Vinicius C Caldeira Carvalho [ 2020-03-06 ] |
|
Thank you Diego, that does solve the problem, using ConfigurableSocketFactory would make it work. Cheers |