An error occurred during the pre-login handshake

If you receive the error message:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: HTTP Provider, error: 0 - )

It is usually caused by a Certificate Validation issue.

The Microsoft.Data.SqlClient that our tools use to connect to SQL Server has been updated and now defaults to Trust Server Certificate = False in situations where previously defaulted to true.

You can resolve this issue by fixing the underlying Certificate Validation issue which will make using Trust Server Certificate = True when connecting unnecessary or you can work around this be setting Trust Server Certificate = True on the connection strings that our tools use:

SQL Compare and SQL Data Compare

SQL Source Control

SQL Change Automation Powershell

SQL Monitor

SQL Compare and SQL Data Compare

GUI:

Add ;Trust Server Certificate=true on the Server field on the Data Source tab of the project

mceclip0.png

Command Line:

Add ;Trust Server Certificate=true on the Server1 or Server2 switch

mceclip1.png

SQL Source Control

You can set Trust Server Certificate to True in the SQL Server Management Studio's Connection Properties Options

SQL Change Automation Powershell

If using a Powershell script:

You just need to add ;Trust Server Certificate=true to your connection string, for example:

Invoke-DatabaseBuild -InputObject $ScriptsFolder -TemporaryDatabase "Server=SQL_Server;Trust Server Certificate=true;Database=Temp_DB"

If using an addon:

Check the Trust Server Certificate check box

mceclip2.png

SQL Monitor

You need to enable the Trust Server Checkbox in the Connection Properties of the monitored server

mceclip3.png

 

Was this article helpful?

1 out of 1 found this helpful
Have more questions? Submit a request