Monday, 16 May 2011

MySQL SSL

We decided to change our architecture so the web server and database run on separate machines.  They are both behind a firewall, however for certain reasons we still decided the db connection should be SSL.

There are instructions on how to set up MySQL to support SSL connections here: http://dev.mysql.com/doc/refman/5.1/en/secure-create-certs.html

It's fairly straightforward although following a server restart we found the following in our MySQL server logs:
SSL error: Unable to get private key
It seems the files generated are not in the correct format.  Somebody else experienced a similar problem: http://forums.mysql.com/read.php?11,400856,401127#msg-401127

We followed that advice, and the server now appeared happy, but the client still could not establish a SSL connection.  We noticed this wasn't a problem on our 64-bit platform and suspicion fell on the OpenSSL implementation.  Checking back at Shining Light, a comment attached to v1.0.0d says "Recommended for brave users" and describes v1.0.0d as a beta version.  Downgraded to v0.9.8r and everything works fine.

Raises an interesting point - the positioning of v1.0.0d on the download page and the slightly unorthodox version numbering tripped me up - I'm sure I'm not the only one.

No comments:

Post a Comment