[CONC-469] auth_socket authentication (MySQL 8 Server) not supported Created: 2020-05-22 Updated: 2020-05-25 Resolved: 2020-05-25 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | 3.1.8 |
| Fix Version/s: | 3.1.9 |
| Type: | Bug | Priority: | Major |
| Reporter: | Klaus Keppler | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | MySQL8, authentication | ||
| Environment: |
MySQL 8.0.20, Ubuntu 20.04 LTS |
||
| Description |
|
Currently it's not possible to connect to a MySQL 8 server using an account configured with auth_socket authentication. I've compiled a minimal test program for the connection:
The MariaDB Connector/C is compiled and linked statically:
The test program runs fine when connecting to a MariaDB 10.3 server (root account configured with plugin unix_socket).
strace output:
Log message in MySQL error.log:
On MySQL 8.0, the plugin column for the root account contains auth_socket, while on MariaDB it is unix_socket:
Maybe this might be a problem? Please let me know if I can provide more informations. I've already had a look at the Connector/C source; the error CR_SERVER_HANDSHAKE_ERR looks to be only returned from within the auth-plugins. Currently the Connector/C can't be used as a "drop-in replacement" in combination with MySQL 8, though the auth code for caching_sha2_pwd already has been included. Thanks & best regards! -Klaus |
| Comments |
| Comment by Klaus Keppler [ 2020-05-22 ] | |||||||||||||||||||
|
Just for comparison: this is the strace when connecting to a MariaDB 10.3 server (Debian 10):
| |||||||||||||||||||
| Comment by Georg Richter [ 2020-05-25 ] | |||||||||||||||||||
|
Obviously there seems to be a bug in MySQL 8.0, since MySQL 8.0 requires that the client uses the caching_sha2_password plugin, even if encryption is not used. Instead of sending a change_auth_plugin request the server returns an error if the client uses the default mysql_native_password plugin (which should be sufficient for socket authentication). This can be reproduced also by using an older mysql command line client (I tested it with mysql command line client version 5.6). A workaround would be to set the default authentication via mysql_options() call:
However the current implementation in Connector/C (but also libmysql) should be improved to avoid sending additional packages: 1) If specified use default authentication method | |||||||||||||||||||
| Comment by Klaus Keppler [ 2020-05-25 ] | |||||||||||||||||||
|
Thank you for your fast & detailed response - that's absolutely great! | |||||||||||||||||||
| Comment by Georg Richter [ 2020-05-25 ] | |||||||||||||||||||
|
Fixed rev. f49bb1c2cd40bc343876bcdd43913d5d1ca27d04 |