How to troubleshoot "Encryption not supported on the client OLE DB provider "SQLNCLI11" for linked server" error We are using LocalDb for integration/unit testing of a .NET Core application. I have been using this solution for months and recently started getting sporadic errors. It seems to happen the first time the tests try to execute a linked server query. The linked server query is hitting another database on the same LocalDb instance on my local machine, i.e. there is not really a remote connection happening.  I am at a loss of how else to troubleshoot.
To set up the linked server connection, we are doing a simple SP call, nothing has changed with this from when it was working consistently.
EXEC sp_addlinkedserver @server='{ServerName}'


Encryption not supported on the client

.
    Test{redacted} Aborted: Exit code is -532462766 (Unhandled exception. System.Data.SqlClient.SqlException (0x80131904): Encryption not supported on the client.
OLE DB provider &quot;SQLNCLI11&quot; for linked server &quot;(localdb)\MSSQLLocalDB&quot; returned message &quot;A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.&quot;.
OLE DB provider &quot;SQLNCLI11&quot; for linked server &quot;(localdb)\MSSQLLocalDB&quot; returned message &quot;Client unable to establish connection&quot;.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
{redacted}


A similar stack track with an SSL credentials error

Exception Info: System.Data.SqlClient.SqlException (0x80131904): SSL Provider: No credentials are available in the security package
It seems you are using always encrypted for some columns in the database. This is not supported or functional with linked servers (or other means of distributed queries), as documented here . Quote from that page:
&quot;The following features don't work on encrypted columns:
Transactional or merge replication
Distributed queries (linked servers, OPENROWSET(T-SQL), OPENDATASOURCE(T-SQL))&quot;
For Always Encryped (AE), the encryption/decryption of data is done by the client, the API on the client side. APIs that supports AE include ADO.NET, JDBC and ODBC. Linked Server uses OLEDB (the calling server is a client to the remote server), and OLEDB do not have the functionality to encrypt/decrypt for AE.