Closed willw-git closed 6 months ago
Oh, and you need to look into whether we can use mysql_options()
instead of the deprecated function resulting in CI errors. If we can't, the warning would need to be disabled.
Thanks for the update, (squash) merged now!
This PR allows SOCI users to pass the ssl-mode parameter described here when connecting to a MySQL database. The setting is passed as
ssl_mode
, with its value set to one of the name constants given in the above documentation:DISABLED, PREFERRED, REQUIRED, VERIFY_CA
andVERIFY_IDENTITY
. Used like this:This patch implies that the documentation at https://soci.sourceforge.net/doc/master/backends/mysql/ needs to be fixed to include this parameter and its possible values.
Motivation: I found that a 32-bit client could not connect to a server, even though the server permitted unencrypted connections. The error returned was 2026. I believe this is because the default value of this parameter is PREFERRED, which implies that TLS protocol negotiations are initiated. Because the 32-bit client is no longer maintained, these fail - and no connection is made. The solution is to turn off SSL entirely (if the security situation permits it).
Of course, the parameter is also generally useful.