0

according to pytds connect documentation we have a way to provide here path to cafile to enable TLS when connecting to Microsoft SQL server. good.

I am not python specialist, what are the other ways to enable TLS using other python database drivers ?

pyodbc, (would it be located on the odbc driver config level) ?

adodbapi...

on windows the certificates are automatically found in repository, it's not the case on unix

the answers provided here are not complete enough concerning TLS in the connection string

(the finality is to use Robotframework-Database-Library to connect to MSSQL enabling only TLS v1.2 connection)

thanks

Tonio
  • 1
  • 1
  • *On windows the certificates are automatically found in repository* Only if you've already added them to Trusted Roots. SQL Server certificates are self-signed by default. – AlwaysLearning Jun 22 '21 at 21:39
  • Have you looked into using pyodbc with "ODBC Driver 17 for SQL Server"? Microsoft documentation walks you through using it from Windows, linux and macOS, [including TLS-capable examples](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/connection-string-keywords-and-data-source-names-dsns#using-tlsssl) using options `Encrypt=yes` with `TrustServerCertificate=no` (for certs in your cert store) and `TrustServerCertificate=yes` (for self-signed certs not in your cert store). – AlwaysLearning Jun 22 '21 at 21:55

0 Answers0