Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disabling SSL for MySQL connection #10276

Closed

Conversation

pvannierop
Copy link
Contributor

Fix #10275

Problem

When migrating the database the migration.py script tries to connect to the MySQL database over SSL, despite the db.use_ssl property having value false.

Analysis

The current and broken logic in migration.py to configure SSL is:

connection_kwargs = {here
if portal_properties.database_use_ssl == 'true':
    connection_kwargs['ssl'] = {"ssl_mode": True}

When I change this to the following, the db.use_ssl property is respected:

connection_kwargs = {}
if portal_properties.database_use_ssl == 'true':
    connection_kwargs["ssl_mode"] = "REQUIRED"
else:
   connection_kwargs["ssl_mode"] = "DISABLED"

Changes in this PR

This PR will add the ssl_mode to the kwargs of the migration script.

@pvannierop pvannierop self-assigned this Jul 14, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jul 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@dippindots dippindots left a comment

Choose a reason for hiding this comment

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

@pvannierop This fix looks good to me, maybe we can merge it along with the #10037

@dippindots
Copy link
Member

Closing this and created #10353

@dippindots dippindots closed this Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration script does not respect db.use_ssl property
2 participants