r2dbc-mysql icon indicating copy to clipboard operation
r2dbc-mysql copied to clipboard

[QUESTION] I would like to use caching_sha2_password authentication type in a situation where sslMode=DISABLED.

Open bereadyfor opened this issue 2 months ago • 3 comments

Summary

I would like to use caching_sha2_password authentication type in a situation where sslMode=DISABLED.

Detailed description

The way I tried it is,

  1. sslMode=DISABLED&allowPublicKeyRetrieval=true
    • Failed
  2. sslMode=DISABLED&allowPublicKeyRetrieval=true&tcpKeepAlive=true
    • Failed
  3. sslMode=DISABLED&allowPublicKeyRetrieval=true&&serverRsaPublicKeyFile=xxx
    • Failed

Relevant context

Error message is, Caused by: io.r2dbc.spi.R2dbcPermissionDeniedException: Authentication type 'caching_sha2_password' must require SSL in full authentication phase

Your environment

  • MySQL version : 8.0.28
  • SSL : none

Additional information

SSL cannot be enabled on the DB server.

Checklist

  • [x] I have searched the existing issues to make sure my question has not been asked before
  • [x] I have provided all the necessary information and context to help answer my question
  • [x] I have read the documentation and/or README for this project (if applicable)

bereadyfor avatar Sep 04 '25 10:09 bereadyfor

chaching_sha2_password requires TLS or RSA(allowPublicKeyRetrieval=true). we don't support the RSA over unencrypted connection. so, sslMode=DISABLED&allowPublicKeyRetrieval=true won't work. please use TLS, or switch to another auth. if RSA is a must, would you be interested in contributing it?

jchrys avatar Sep 04 '25 11:09 jchrys

I once contributed a similar case to jasync-sql https://github.com/jasync-sql/jasync-sql/issues/397 https://github.com/jasync-sql/jasync-sql/pull/398/files

Are you talking about this?

bereadyfor avatar Sep 05 '25 01:09 bereadyfor

@bereadyfor need to implement similar functionality to enable caching_sha2_password when sslMode=DISABLED.

jchrys avatar Sep 15 '25 14:09 jchrys