0

I have a Python script written to connect to a SQL database in Azure, and I am getting the error below:

9002 (28000): SSL connection is required. Please specify SSL options and retry.

Clearly I need to include SSL credentials, but I'm unsure of how to do this given the rest of the formatting of my config file.

I currently have a dictionary with the database access credentials in it formatted as 'key' : 'value'.

The SSL arguments I've seen seem to go in additional dictionaries or are non-string variables. Anyway, I just need someone to show me...

  1. how to format it, and
  2. examples of what they look like (ssl_ca, ssl_cert, and ssl_key)

Here is the dictionary in my config file, with the actual names of things of course changed.

config = {
'user': 'username@database',
'password':'mypassword',
'host':'hostname.database.windows.net',
'database':'databasename'
}

Thanks!

mdecpm
  • 15
  • 1
  • 6
  • Possible duplicate of [SQLAlchemy verify SSL connection](https://stackoverflow.com/questions/55267373/sqlalchemy-verify-ssl-connection) – Edeki Okoh May 10 '19 at 00:19
  • @EdekiOkoh No, this is not a duplicate. – mdecpm May 10 '19 at 01:02
  • please include some samples of your code – JD D May 10 '19 at 02:07
  • Here you go: https://stackoverflow.com/a/14992181/6560549 – SuperShoot May 10 '19 at 02:10
  • Thanks @SuperShoot, but are all of those ('cert', 'key', and 'ca') required SSL arguments? I am able to connect using PyMySQL with just the 'cert' filepath. The issue is I specifically need to make use of SQLAlchemy. – mdecpm May 13 '19 at 17:11

0 Answers0