Skip to content

Conversation

@SteRiccio
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modifies the database migration SSL configuration to support unauthorized SSL connections by utilizing the pgSslAllowUnauthorized environment variable. When enabled, this allows SSL connections without certificate validation.

Key changes:

  • Modified SSL configuration to conditionally set rejectUnauthorized: false based on the pgSslAllowUnauthorized flag
  • The configuration applies uniformly across development, production, and test environments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 19 to 23
ssl: ProcessEnv.pgSslAllowUnauthorized
? {
rejectUnauthorized: false,
}
: ProcessEnv.pgSsl,
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SSL configuration change applies to all environments including production (see line 31 in getConfig). Allowing unauthorized SSL connections in production environments can expose the application to man-in-the-middle attacks and defeats the purpose of SSL/TLS encryption.

Consider whether pgSslAllowUnauthorized should only be respected in development/test environments, or add explicit warnings in documentation about the security implications of enabling this setting in production.

Suggested change
ssl: ProcessEnv.pgSslAllowUnauthorized
? {
rejectUnauthorized: false,
}
: ProcessEnv.pgSsl,
ssl:
ProcessEnv.nodeEnv !== 'production' && ProcessEnv.pgSslAllowUnauthorized
? {
rejectUnauthorized: false,
}
: ProcessEnv.pgSsl,

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

@SteRiccio SteRiccio merged commit efb4b4c into master Jan 5, 2026
5 checks passed
@SteRiccio SteRiccio deleted the fix/dbmigrate-allow-unauthorized branch January 5, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants