title: SSL connection error when connecting to RDS MySQL from Django
body: <p>I'm trying to deploy a Django app on Heroku with an RDS instance as the database backend. Everything is working until I try to encrypt the connection, then I get this error:</p>
  
  <pre><code>OperationalError at /path/
  (2026, 'SSL connection error')
  </code></pre>
  
  <p>Here's the setup:</p>
  
  <ul>
  <li>Standard Django application</li>
  <li>MySQL RDS instance with security group allowing connections from all IP addresses</li>
  <li>MySQL user is setup to allow connections from any host</li>
  <li>Amazon's pem has been downloaded and is specified in Django settings</li>
  </ul>
  
  <p>On Heroku:</p>
  
  <pre><code>DATABASE_URL: mysql2://username:password@instance.us-east-1.rds.amazonaws.com:3306/name_staging?sslca=path/to/mysql-ssl-ca-cert.pem
  </code></pre>
  
  <p>In Django settings:</p>
  
  <pre><code>DATABASES = {
      'default': dj_database_url.config()
  }
  DATABASES['default']['OPTIONS'] = {'ssl': {'ca': 'mysql-ssl-ca-cert.pem'}}`
  </code></pre>
  
  <p>I've tried searching and have read a lot about setting this type of environment up in Rails, but the documentation about doing this with Django is light to non-existent.</p>
  
  <p>Has anyone out there successfully deployed a similar setup or does anyone have thoughts on how to solve this error?</p>
  
  <p>Update:</p>
  
  <p>Connecting via cli works as well as connecting directly using MySQLdb in the python interpreter.</p>