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 #10353

Merged
merged 1 commit into from
Sep 6, 2023
Merged

Fix disabling SSL for MySQL connection #10353

merged 1 commit into from
Sep 6, 2023

Conversation

dippindots
Copy link
Member

Copied from #10276

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.

@dippindots dippindots added the bug label Aug 29, 2023
@dippindots dippindots requested a review from pvannierop August 29, 2023 07:40
@dippindots dippindots self-assigned this Aug 29, 2023
Copy link
Contributor

@pvannierop pvannierop left a comment

Choose a reason for hiding this comment

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

I think there is a mismatch in the translation from my PR to this PR.

core/src/main/scripts/importer/cbioportal_common.py Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 1, 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

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@inodb inodb merged commit c8d815c into master Sep 6, 2023
@inodb inodb deleted the migrate_db_ssl branch September 6, 2023 14:33
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
3 participants