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

The format of the Protocol::HandshakeV10 packet sent by the server is specified at

The format of the Protocol::SSLRequest packet is defined at

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

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

Sorry, only registered users may post in this forum.

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.