Can Pymssql have a secure connection (SSL) to MS SQL Server?

前端 未结 4 1393
逝去的感伤
逝去的感伤 2021-01-21 03:35

I\'m making queries from a MS SQL server using Python code (Pymssql library) however I was wondering if there was any way to make the connection secure and encrypt the data bein

4条回答
  •  有刺的猬
    2021-01-21 04:19

    Yes, it can.

    You need FreeTDS which supports SSL via OpenSSL. If you happened to use Linux (or Docker on Windows), it's quite easy to install standalone FreeTDS in Debian:

    apt-get update
    apt-get install freetds-bin freetds-dev
    pip install pymssql
    

    Don't use pymssql with bundled FreeTDS library, it does not support SSL apparently. The bundled library is used when you set env variable PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1 before installing pymssql.

提交回复
热议问题