mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

It is not possible to explicitly set the SSL/TLS protocol

Open jcouball opened this issue 6 years ago • 2 comments

I need to set the TLS version to TLSv1.2 via the MYSQL_OPT_TLS_VERSION MySQL connection option.

https://dev.mysql.com/doc/refman/5.7/en/mysql-options.html https://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-protocols-ciphers.html

Is this possible with Mysql2? Maybe with :connect_attrs?

jcouball avatar May 16 '18 19:05 jcouball

This is not currently possible. A new option handler needs to be added here: https://github.com/brianmario/mysql2/blob/eca4d2552f605e14d8d935d67c36d7f83b2bf89b/ext/mysql2/client.c#L844

sodabrew avatar May 16 '18 20:05 sodabrew

Thank you for the response, @sodabrew. I have been sidetracked by other things at the moment, but will revisit this soon. If I find I really need it, I'll take a crack at submitting a PR to add it.

jcouball avatar May 19 '18 06:05 jcouball