microsoft / vscode-remote-try-sqlserver

SQL Server and Azure SQL sample project for trying out the Dev Containers extension
MIT License
37 stars 15 forks source link

mention they need to add this string to the connection string to connect locally with .NET "TrustServerCertificate=true" #19

Open roryp opened 1 year ago

roryp commented 1 year ago

I try to connect to the sql server with C# but I needed to add "TrustServerCertificate=true" to the connection string. I recommend configuring the container with the certificate used by the sql container

cmaneu commented 1 year ago

As discussed with Rory, the best action would be to trust the SQL certificate within the devcontainer. There is no mention of a way to pass a TLS Certificate into the container in the documentation.

However it seems you can configure the TLS cert in SQL Server for Linux https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-mssql-conf?view=sql-server-2017#tls

It might be possible with a custom container https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-docker-container-configure?view=sql-server-2017&pivots=cs1-bash

Additional doc: https://stackoverflow.com/questions/67438924/sql-server-2017-on-linux-kubernetes-set-up-tls-security