You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to connect to an RDS database (Aurora+SSL+IAM DB authentication) triggers a slice bounds out of range panic. I'm not sure if I'm missing something in my configuration, but I'm able to connect successfully to the database using mysql-client like so:
mysql -u [username] -h [endpoint] -p[password] --ssl-ca=rds-combined-ca-bundle.pem --enable-cleartext-plugin
It is simple to find that pluginEndIndex+1 > len(data)-1 which means pluginEndIndex >= len(data) -1 and thus pluginEndIndex==len(data-1).
Because the auth string is "\xFEmysql_clear_password\x00auth_string", the auth_string is [string.EOF] so Aurora just send "\xFEmysql_clear_password\x00", this response is match the clear password protocol.
The bug of the driver is that it assume the auth_string is [string.NUL] or auth_string is not empty which ends with '\x00'. That assumption is not correct.
@heimweh You solution is correct, but please make sure do not break mysql_old_password and mysql_native_password.
Issue description
Trying to connect to an RDS database (Aurora+SSL+IAM DB authentication) triggers a slice bounds out of range panic. I'm not sure if I'm missing something in my configuration, but I'm able to connect successfully to the database using
mysql-client
like so:Expected output:
Actual output:
With this change I got it to work (although it's probably not the right fix):
Example code
Configuration
Driver version (or git SHA): bf7f34f
Go version: go version go1.8.3 darwin/amd64
Server version: AWS RDS (Aurora MySQL)
The text was updated successfully, but these errors were encountered: