Skip to content

Verify SQL Server certificates by default - #346

Merged
Maxteabag merged 1 commit into
mainfrom
fix/mssql-verify-server-cert
Oct 22, 2026
Merged

Maxteabag merged 1 commit into
mainfrom
fix/mssql-verify-server-cert

Conversation

@Maxteabag

Copy link
Copy Markdown
Owner

SQL Server connections sent TrustServerCertificate=yes by default, so sqlit never checked the server's certificate, Azure SQL included. Anyone on the network path could pose as the server and receive the login.

With the default TLS mode, sqlit now leaves verification on. The exceptions are servers on this machine (localhost, 127.0.0.1, .\INSTANCE, LocalDB), where a self-signed certificate is normal and nobody can intercept. The trust option is hidden in default mode, so a yes stored on existing connections is just the old form default and is ignored. Connections where someone deliberately picked a TLS mode keep their settings.

When a server's certificate can't be verified (typically a self-signed internal server), the connection error now asks "Trust this server?" instead of just failing. Yes switches that connection to encrypt-without-verify (tls_mode=require, trust yes), saves it and reconnects, like SSH asking about a new host key.

Heads-up for release notes: users with a self-signed SQL Server that isn't on their own machine get that one prompt the first time they connect after upgrading.

@Maxteabag
Maxteabag merged commit 60ec0b4 into main Oct 22, 2026
23 checks passed
@Maxteabag
Maxteabag deleted the fix/mssql-verify-server-cert branch October 22, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant