Open
Description
If mariadb-corporation/mariadb-connector-c#227 is accepted, then MySqlConnector should also support the new TLS handshake.
Exact details are in that case and subject to change, but at a high level:
- Server exposes "supports SSL Request V2" bit
- Client sends new two-byte SSL Request V2 packet
- Client should (must?) verify CA to avoid MitM
- Client sends handshake response with "supports SSL Request V2" bit set
Activity
dlenski commentedon Jul 11, 2023
Thanks for creating this!
As I just noted in mariadb-corporation/mariadb-connector-c#227 (comment) …
I believe this will be necessary for non-MariaDB-specific clients like yours to receive the appropriate capability bit from the server (
Server exposes "supports SSL Request V2" bit
).dlenski commentedon Jul 11, 2023
As it's currently implemented in mariadb-corporation/mariadb-connector-c#227 and MariaDB/server#2684, the client's initial (plaintext) packet will contain only the
CLIENT_SSL
bit.However, in the post-TLS packet, the client should send the
CLIENT_CAN_SSL_V2
bit, because this will allow the server to detect a downgrade attack in which a MITM has forced the client not to use the SSL V2 handshake.https://github.com/MariaDB/server/pull/2684/files#diff-df544694418bef1c4bc6cdc5211ca133e7ad4d31901f16d0fdee8df6e4debe89R12792-R12813
bgrainger commentedon Jul 11, 2023
Yes, that's what I meant in my issue. The handshake packet is now only sent after TLS is negotiated (because what would have been the first "handshake response" is now replaced with "SSL Request V2").