I am trying to deploy a Django application on Heroku with an RDS instance as the database. Everything works until I try to encrypt the connection, then I get this error:
OperationalError at /path/ (2026, 'SSL connection error')
Here's the setting:
- Django Standard Application
- A MySQL RDS instance with a security group that allows connections from all IP addresses.
- MySQL user configured to allow connections from any host
- Amazon pem is loaded and specified in Django settings.
On Heroku:
DATABASE_URL: mysql2://username: password@instance.us-east-1.rds.amazonaws.com :3306/name_staging?sslca=path/to/mysql-ssl-ca-cert.pem
In Django settings:
DATABASES = { 'default': dj_database_url.config() } DATABASES['default']['OPTIONS'] = {'ssl': {'ca': 'mysql-ssl-ca-cert.pem'}}`
I tried searching and read a lot about setting up this type of environment in Rails, but the documentation about it with Django is easy for nonexistent.
Has anyone out there successfully deployed a similar setup, or does anyone have thoughts on how to resolve this error?
Update:
The connection through cli works, and also connects directly using MySQLdb in the python interpreter.
source share