Skip to content

feat: added ssl option for database#79

Merged
scolastico merged 1 commit intomainfrom
fix/db-ssl
Feb 5, 2026
Merged

feat: added ssl option for database#79
scolastico merged 1 commit intomainfrom
fix/db-ssl

Conversation

@scolastico
Copy link
Member

Description

This PR adds support for SSL/encrypted database connections. This fixes a bug where the API fails to connect to databases (like DigitalOcean Managed Postgres) that enforce encrypted connections.

Specifically, it:

  • Adds DATABASE_SSL and DATABASE_SSL_REJECT_UNAUTHORIZED environment variables to DatabaseConfig.
  • Refactors DatabaseService to properly apply SSL settings to the Knex connection object when using pg or mysql modes.
  • Ensures only relevant connection properties are passed to Knex for better robustness.

Related Issue

closes not-three/main#28

Checklist

  • I have tested my changes locally (via build and linting)
  • I have updated the documentation if needed (configuration model updated)
  • This PR follows the project's coding style

Additional Notes

Users can now enable SSL by setting DATABASE_SSL=true. If using self-signed certificates or certain managed providers, DATABASE_SSL_REJECT_UNAUTHORIZED=false may also be required.

@scolastico scolastico merged commit f5e9a62 into main Feb 5, 2026
2 checks passed
@scolastico scolastico deleted the fix/db-ssl branch February 5, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Connection failure to postgres if connection must be encrypted

1 participant