mysql SSL connection
mysql SSL connection
stenberg
Posts: 10Questions: 2Answers: 0
Apologies if this is already in here somewhere, but I can't seem to find documentation on how to setup config file for a standard mysql SSL connection using certificates to encrypt the connection.
EDIT: Just to be clear we already use SSL connections on our database exclusively so I am not asking how to set that up, just how to pass certificates in config file.
This discussion has been closed.
Replies
Excellent question! There isn't actually a way to configure that for the PDO connection that Editor creates at the moment - but let me get back to you on that tomorrow morning. I'll add it in as I think this is a useful thing to have and I'll post details of the patch (it will be relatively simple I think).
Regards,
Allan
Thanks very much! I was just starting to dig in to the PDO connection and came to the same conclusion. Really look forward to the patch.
Regards
Steve
Hi Steve,
Here we go: in
php/Database/Driver/Mysql/Query.php
replace theconnect
static method with:Then all you need to do is add a
pdoAttr
option to your$sql_details
array inconfig.php
with the PDO attributes you want to use - e.g.:And that should do it
Allan
TL;DR The patch works fine!
For the benefit of anybody using this I had to go a little further down the rabbit hole. First, only the certificate authority seems to be needed.
Even then, if you point it to a bogus path it still works, so in other words the mere presence of PDO::MYSQL_ATTR_SSL_CA pointing to a random string is enough also. That particular bit of weirdness is because apparently there is no checking of the certificate done; the driver just needs to know you want to use SSL.
But the bottom line is, after creating a user "REQUIRE SSL" (to be certain) and putting in a SHOW STATUS LIKE 'Ssl_cipher' in the connection code as a test, its definitely working as expected.
Thanks for such an incredibly fast response!
SSL certs are always good fun...!
Great to hear that does the job for you. It will be in the next release of Editor - probably a 1.6.4 release in early August.
Regards,
Allan