Azure SQL - Public Endpoint - Secure Connection

juni dev 361 Reputation points
2020-06-18T09:34:56.917+00:00

Hi,

I'm using a managed SQL instance with public endpoint,

From here: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/public-endpoint-overview
it says: "...SQL Managed Instance data traffic is always encrypted if the client driver supports encryption."

How can I assure my connection encrypts the data?
The application uses this file DSN:

[ODBC]
DRIVER=ODBC Driver 17 for SQL Server
UID=myUser
TrustServerCertificate=No
Address=myServer,1433
Network=DBMSSOCN
DATABASE=myDB
WSID=myClientMachine
APP=Microsoft® Windows® Operating System
Trusted_Connection=No
SERVER=MyManagedInstance
Authentication=SqlPassword
PWD=myUserPassword

Many Thanks

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Ubezzi 2,776 Reputation points
    2020-06-18T21:48:15.75+00:00

    Hi @juni dev - Yes, the version of the driver you are using supports encryption. You could add the below entry to the DSN file to force encryption but as stated, client encryption is enabled by default if supported by the connecting client driver and encryption is supported in this case.

    ODBC: Encrypt=yes

    Just a note, the following entry ensures that the client connection is using a CA verified certificate:

    TrustServerCertificate=No

    Encryption uses the certificate on the server. This must be verified by a certificate authority, unless the connection attribute SQL_COPT_SS_TRUST_SERVER_CERTIFICATE is set to SQL_TRUST_SERVER_CERTIFICATE_YES or the connection string contains "TrustServerCertificate=yes". If either of these conditions is true, a certificate generated and signed by the server can be used to encrypt the connection if no certificate is on the server.

    Encryption is currently taking place. Please let me know if you have any additional questions.

    Regards,
    Mike


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.