I need to connect with pyodbc to a mssql server and receive following error:
('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:EE certificate key too weak] (-1) (SQLDriverConnect)')
My connection string is as following:
try:
conn_str = f'DRIVER={{ODBC Driver 18 for SQL Server}};SERVER={self._server};DATABASE={self._database};UID={self._username};PWD={self._password}'
conn = pyodbc.connect(conn_str)
cursor = conn.cursor()
return cursor
except pyodbc.Error as err:
print('pyodbc error')
print(str(err))
How to avoid the check of the ssl certificate?
1条答案
按热度按时间ajsxfq5m1#
In the connection string add:
Encrypt=no;