node-mysql2
node-mysql2 copied to clipboard
Server with SSL?
Is it possible to use Mysql2 in server mode with the server using SSL? If not, should it be able to do so? Just enabling SSL with capabilityFlags doesnt seem to work, plus there is no way to currently pass any configuration for connections in through server and the ServerHandshake command does not seem to support it.
Just want to make sure I am not missing something.
need to double check, definitely not possible with just a config option ( but I'm keen to add this functionality )
For fun I did add a way to pass config options into the server connection, but when I enable SSL in the capabilityFlags I get invalid commands, presumably because they are encrypted and nothing decrypts them.
if you want to hack on this the help would be definitely appreciated Documentation on SSL negotiation and upgrade: https://dev.mysql.com/doc/internals/en/ssl.html Code on the client side: https://github.com/sidorares/node-mysql2/blob/ebc2cb438d380d81d57ae6e2d227bfafc684eb2a/lib/commands/client_handshake.js#L121
Also in need of running a mysql2
server with SSL support. Traced things through to where the SSL client request is being mis-parsed because it's assumed to be a handshake response. I'm up for putting in some effort to create a patch.
Ended up simply putting a terminating SSL proxy in front. Works great!