We needed to set up an stunnel to the mysql server (mysql.example.com), so that the client (client.example.com) and the server can communicate over an encrypted tunnel. Stunnel was already installed on both linux machines – it is avaialble from http://stunnel.org. The steps taken on mysql.example.com were: cd /etc/stunnel Create a certificate: openssl req -x509 -nodes -days 365 -newkey rsa:1024 \