[GH-ISSUE #1835] Cannot connect to database with SSL mode, missing OPTIONS #1440

Open
opened 2026-02-27 11:17:07 +03:00 by kerem · 0 comments
Owner

Originally created by @roniemartinez on GitHub (Feb 14, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1835

Impacted versions

  • Modoboa: 1.14.1
  • installer used: Yes & No
  • Webserver: Nginx

Steps to reproduce

  1. Create a managed database (MySQL/PosgreSQL) in DigitalOcean. CA Certificates are generated and REQUIRED when connecting.
  2. Set database url using --dburl when not using installer or modify via settings.py

Current behavior

Modoboa does not accept SSL in options or generate the entries. See deploy.py https://github.com/modoboa/modoboa/blob/master/modoboa/core/commands/deploy.py#L30-L32

Expected behavior

SSL Options should be appended in settings.py similar to the code below:

'default': {
              'ENGINE': 'django.db.backends.mysql',  
              'NAME': '<DATABASE NAME>',                     
              'USER': '<USER NAME>',
              'PASSWORD': '<PASSWORD>',
              'HOST': '<HOST>', 
              'PORT': '3306'    
              'OPTIONS':  {
                        'ssl': {'ca': '<PATH TO CA CERT>',
                                'cert': '<PATH TO CLIENT CERT>',
                                'key': '<PATH TO CLIENT KEY>'
                                }
                          }
            }
}

Reference: https://stackoverflow.com/questions/4323737/how-to-connect-django-to-a-mysql-database-over-an-ssl-connection

Originally created by @roniemartinez on GitHub (Feb 14, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1835 # Impacted versions * Modoboa: 1.14.1 * installer used: Yes & No * Webserver: Nginx # Steps to reproduce 1. Create a managed database (MySQL/PosgreSQL) in DigitalOcean. CA Certificates are generated and REQUIRED when connecting. 2. Set database url using --dburl when not using installer or modify via settings.py # Current behavior Modoboa does not accept SSL in options or generate the entries. See `deploy.py` https://github.com/modoboa/modoboa/blob/master/modoboa/core/commands/deploy.py#L30-L32 # Expected behavior SSL Options should be appended in `settings.py` similar to the code below: ```DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '<DATABASE NAME>', 'USER': '<USER NAME>', 'PASSWORD': '<PASSWORD>', 'HOST': '<HOST>', 'PORT': '3306' 'OPTIONS': { 'ssl': {'ca': '<PATH TO CA CERT>', 'cert': '<PATH TO CLIENT CERT>', 'key': '<PATH TO CLIENT KEY>' } } } } ``` Reference: https://stackoverflow.com/questions/4323737/how-to-connect-django-to-a-mysql-database-over-an-ssl-connection
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1440
No description provided.