MySQL Forums
Forum List  »  Connector/Node.js

Re: Understanding SSL connection with MySQL protocol
Posted by: Rui Quelhas
Date: February 15, 2023 11:04AM

Hi Austin,

the MySQL protocol specifies an exchange where the server initially sends an handshake packet (Protocol::HandshakeV10 in MySQL 8.0) to the client, which can then enable TLS in the connection (if the server advertises support in the capabilities present in the handshake packet) by sending a Protocol::SSLRequest packet, which can then be followed by the expected Protocol::HandshakeResponse packet to proceed with the user authentication.

The whole lifecycle is documented at https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase.html.

The format of the Protocol::HandshakeV10 packet sent by the server is specified at https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_handshake_v10.html

The format of the Protocol::SSLRequest packet is defined at https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_ssl_request.html.

In your case, without looking too deep into it, it looks like you are trying to promote a regular socket to a TLS socket, but that socket has been disconnected in the meantime, either by you or the server. You need to ensure you are not sending anything unexpected to the server before enabling TLS in the socket or check if the server hasn't sent any ERR_Packet beforehand.


Hope it helps.

Options: ReplyQuote


Subject
Written By
Posted
Re: Understanding SSL connection with MySQL protocol
February 15, 2023 11:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.