Skip to content

Commit

Permalink
Fix disabling SSL for MySQL connection
Browse files Browse the repository at this point in the history
  • Loading branch information
dippindots committed Sep 1, 2023
1 parent 3f07318 commit 637d419
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/scripts/importer/cbioportal_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,9 +1090,13 @@ def get_db_cursor(portal_properties: PortalProperties):
"port": url_elements.port if url_elements.port is not None else 3306,
"db": url_elements.paths[0],
"user": portal_properties.database_user,
"passwd": portal_properties.database_pw,
"ssl": "useSSL" not in url_elements.query or url_elements.query["useSSL"] == "true"
"passwd": portal_properties.database_pw
}
if url_elements.query["useSSL"] == "true":
connection_kwargs['ssl'] = {"ssl_mode": True}
connection_kwargs['ssl_mode'] = 'REQUIRED'
else:
connection_kwargs['ssl_mode'] = 'DISABLED'
connection = MySQLdb.connect(**connection_kwargs)
except MySQLdb.Error as exception:
print(exception, file=ERROR_FILE)
Expand Down

0 comments on commit 637d419

Please sign in to comment.