Skip to content

Commit

Permalink
Merge pull request cBioPortal#10353 from cBioPortal/migrate_db_ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
inodb authored Sep 6, 2023
2 parents 49423ce + 637d419 commit c8d815c
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 c8d815c

Please sign in to comment.