Should check server SSL capability
See original GitHub issueIt is also MySQL 5.6 compatibility problem for #32 .
MySQL 5.6.x Community Edition does not support SSL, so if the user has enabled SSL and the MySQL server is 5.6.x Community Edition, the user will receive an error message containing a handshake failure.
In this case, checking the MySQL server capabilities in HandshakeV10Message
will be more useful than checking the MySQL server version.
My personal opinion is that for MySQL, SSL cannot support only enable/disable, and should support the following 3 modes:
- REQUIRED (high security): if server not support SSL, then throw a exception to channel (connection will be close by this exception)
- OPTIONAL (default mode): if server not support SSL, then disable SSL.
- DISABLED (plain mode): use plain connection without SSL.
R2DBC ConnectionFactoryOptions.SSL
is a boolean option, I try treat true
same as OPTIONAL
, and append a SSL option Option.<Boolean>valueOf("sslRequired")
for enable REQUIRED
mode.
@mp911de Should I support optional SSL mode for MySQL 5.6 compatibility?
Another plan is just throw an exception and close the connection when the user has enabled SSL and the MySQL server does not support SSL. Then r2dbc-mysql
still only has two modes, ENABLED
or DISABLED
. (Equivalent to ENABLED
same as REQUIRED
, and the OPTIONAL
mode is removed)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Not setting SSL to true means SSL config is undefined. We had a similar discussion at https://github.com/r2dbc/r2dbc-postgresql/pull/104
SSL_MODE
has supported yet, and single flagSSL
would been keep.