Configuring Django to use a MySQL-Server via SSL

Currently, I'm using Django to develop some internally used applications. For one of them, I had to use a SSL connection to access a MySQL database. As development environment, I'm using Fedora 17, of course.

During that process, I ran into two bugs:

  • MySQL 5.5 doesn't export HAVE_OPENSSL anymore, as it has done in earlier versions. This causes MySQL-python to assume, SSL is deactivated during build. Patching _mysql.c from MySQL-python to ignore that, fixes it.

  • It seems, ssl-connection parameters in Django have to be specified something like this:

    'database': {
            'OPTIONS': {'ssl':{
                        'cipher': 'DHE-RSA-AES256-SHA'