add MYSQL_SSL_* to the driver for MySQL connections #19
Manually merged
TDE
merged 1 commits from tqt3-mysql-ssl
into master
5 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'tqt3-mysql-ssl'
Deleting a branch is permanent. It CANNOT be undone. Continue?
added:
MYSQL_SSL_KEY, MYSQL_SSL_CERT, MYSQL_SSL_CA, MYSQL_SSL_CAPATH options
to manage MySQL/MariaDB connections
Signed-off-by: Denis Kozadaev denis@dilos.org
Overall it looks good. Just need to polish up the points pointed out in the individual comments
if (clientOptionFlags & CLIENT_SSL) {
mysql_ssl_set(d->mysql,
ssl_key.isNull()? static_cast<const char *>(0):ssl_key.latin1(),
It is better to use isEmpty() instead of isNull() since it can catch the case where a string is == "" rather than null.
accepted, I will change it to isEmpty()
if (clientOptionFlags & CLIENT_SSL) {
mysql_ssl_set(d->mysql,
ssl_key.isNull()? static_cast<const char *>(0):ssl_key.latin1(),
ssl_cert.isNull()? static_cast<const char *>(0):ssl_cert.latin1(),
Is there a specific reason for using latin1()?
I have been discussing this with Slavek and we think local8Bit() is a better option since most likely those fields refer to local files (private key, public key and so on).
modern file systems use utf8, are you sure about local8Bit()?
maybe utf8() or ascii()
local8Bit()
is the correct choice because the result matches locales == if the user uses utf8, then the resultlocal8Bit()
will be the same asutf8()
, if it uses a different character set, the result will match the locales character set.@denis you'll need to get a little bit of practice in using git 😉
I cleaned up the commits in your pull-request again to be one clean commit where you're listed as the author.
4f528c3bd2
.