Title: SSL Mode support for MySQL · Issue #337 · jasync-sql/jasync-sql · GitHub
Open Graph Title: SSL Mode support for MySQL · Issue #337 · jasync-sql/jasync-sql
X Title: SSL Mode support for MySQL · Issue #337 · jasync-sql/jasync-sql
Description: Hello! I would like to ask if there's a plan to support sslMode configuration for MySQL database? According to FAQ, currently, only PostgreSQL is supported. I also noticed that com.github.jasync.sql.db.SSLConfiguration defaults to sslMod...
Open Graph Description: Hello! I would like to ask if there's a plan to support sslMode configuration for MySQL database? According to FAQ, currently, only PostgreSQL is supported. I also noticed that com.github.jasync.sq...
X Description: Hello! I would like to ask if there's a plan to support sslMode configuration for MySQL database? According to FAQ, currently, only PostgreSQL is supported. I also noticed that com.github.jasyn...
Opengraph URL: https://github.com/jasync-sql/jasync-sql/issues/337
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSL Mode support for MySQL","articleBody":"Hello!\r\n\r\n**I would like to ask if there's a plan to support `sslMode` configuration for MySQL database?** According to FAQ, currently, only PostgreSQL is supported. I also noticed that `com.github.jasync.sql.db.SSLConfiguration` defaults to `sslMode=disabled` mode for MySQL which leads to problems when the MySQL Server is configured to enforce SSL connections.\r\n\r\nI had a look at the implementation details and found that this library integrates with R2DBC SPI (https://r2dbc.io/spec/0.8.1.RELEASE/spec/html/#overview.connection.discovery). The driver will be discovered by R2DBC SPI which will use `com.github.jasync.r2dbc.mysql.MysqlConnectionFactoryProvider#create` to create `io.r2dbc.spi.ConnectionFactory` object:\r\n```kotlin\r\n// from: com.github.jasync.r2dbc.mysql.MysqlConnectionFactoryProvider#create\r\n@Suppress(\"NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS\")\r\noverride fun create(connectionFactoryOptions: ConnectionFactoryOptions): JasyncConnectionFactory {\r\n val configuration = Configuration(\r\n host = connectionFactoryOptions.getValue(HOST),\r\n port = connectionFactoryOptions.getValue(PORT),\r\n username = connectionFactoryOptions.getValue(USER),\r\n password = connectionFactoryOptions.getValue(PASSWORD)?.toString(),\r\n database = connectionFactoryOptions.getValue(DATABASE),\r\n applicationName = connectionFactoryOptions.getValue(APPLICATION_NAME),\r\n connectionTimeout = connectionFactoryOptions.getValue(CONNECT_TIMEOUT)?.toMillis()?.toInt() ?: 5000,\r\n queryTimeout = connectionFactoryOptions.getValue(QUERY_TIMEOUT)\r\n )\r\n return JasyncConnectionFactory(MySQLConnectionFactory(configuration))\r\n}\r\n```\r\nThe above method does not configure `com.github.jasync.sql.db.SSLConfiguration` and thus, the default `sslMode` (`Mode.Disable`) will be used. Even though, the `connectionFactoryOptions` could have the option `ssl` set to `true` or any `sslMode` parameter specified.\r\n\r\nI suspect that changing this factory to interpret the `ssl` and `sslMode` parameter of `connectionFactoryOptions` would quickly resolve the issue. It seems that `com.github.jasync.sql.db.mysql.MySQLConnection#onHandshake` already supports SSL.\r\n\r\n**I would be happy to contribute and resolve this issue**. But first I would like to make sure:\r\n - Is my understanding of current implementation described above correct?\r\n - The ssl option in `connectionFactoryOptions` would return true in case the secure protocol (`r2dbcs`) is used. However how should it handle the combination of secure protocol and `sslMode=disabled`, for example through the following connection string: `r2dbcs:mysql://example.com?sslMode=disabled`?\r\n - Should my contribution also support other MySQL parameters. If so, would anyone be able to specify which? I know there are legacy parameters like 'useSSL', 'requireSSL', and 'verifyServerCertificate' which are still accepted but translated into a value for 'sslMode' by MySQL Server. The `com.github.jasync.sql.db.SSLConfiguration` also accepts `sslrootcert`, `sslcert`, `sslkey`.\r\n\r\nThanks!\r\n\r\n","author":{"url":"https://github.com/tkurylek","@type":"Person","name":"tkurylek"},"datePublished":"2022-12-05T07:49:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/337/jasync-sql/issues/337"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:15f6ea9c-c9f8-8622-a63b-9c944f065da2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0C8:3207D8:15A9FD9:1B8B478:697F20B1 |
| html-safe-nonce | b312bd8d65b214515366a9c9e9dce7af8ad117aa83ac344b7091baf9c5553bfe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEM4OjMyMDdEODoxNUE5RkQ5OjFCOEI0Nzg6Njk3RjIwQjEiLCJ2aXNpdG9yX2lkIjoiODQwMTkyOTgyMjA5MTAyNjYwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5cc454c523cbdd217e6f5ba6df15896b4806bc19bffe3b05d2469d1167b2ecf2 |
| hovercard-subject-tag | issue:1475931786 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/jasync-sql/jasync-sql/337/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f4f47cb0c083e75e4edde0d480cefcd2f0904f0c31e737956325e3490242557a/jasync-sql/jasync-sql/issues/337 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f4f47cb0c083e75e4edde0d480cefcd2f0904f0c31e737956325e3490242557a/jasync-sql/jasync-sql/issues/337 |
| og:image:alt | Hello! I would like to ask if there's a plan to support sslMode configuration for MySQL database? According to FAQ, currently, only PostgreSQL is supported. I also noticed that com.github.jasync.sq... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tkurylek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/jasync-sql/jasync-sql git https://github.com/jasync-sql/jasync-sql.git |
| octolytics-dimension-user_id | 42655245 |
| octolytics-dimension-user_login | jasync-sql |
| octolytics-dimension-repository_id | 145898133 |
| octolytics-dimension-repository_nwo | jasync-sql/jasync-sql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145898133 |
| octolytics-dimension-repository_network_root_nwo | jasync-sql/jasync-sql |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width