Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement secure connection #27

Open
sidorares opened this issue May 26, 2011 · 0 comments
Open

implement secure connection #27

sidorares opened this issue May 26, 2011 · 0 comments

Comments

@sidorares
Copy link
Owner

if server support secure connection, client should be able to negotiate and switch to secure channel.

Upgrade a regular net.Stream connection to a secure tls connection: https://gist.github.com/848444
http://stackoverflow.com/questions/5146666/starttls-on-node-js-0-4-0

http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#Encryption

If the server advertises SSL (aka TLS) capability by setting the CLIENT_SSL flag in the initial greeting packet, then the client can request that the connection be encrypted.
For an encrypted connection, the client first sends an abbreviated client authentication packet containing only the flags word, with the CLIENT_SSL bit set. Without waiting for a server response, the client then begins the TLS handshake (starting with the ClientHello message). Once the SSL/TLS session has been established, the client sends the full client authentication packet over the newly established channel (including the flags field again, as well as the remaining authentication fields). The server responds to this client authentication packet as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant