0

Here's my situation. There are three servers:

  1. Windows Server 2016 (Server-1)
  2. Windows Server 2016 (Server-2)
  3. Windows Server 2016 with SQL Server 2016 (Server-SQL)

I have some C# code which connects to Server-SQL which is identical on both Server-1 and Server-2 with identical connection strings.

The connection string looks something like this:

Provider=MSOLEDBSQL;Server=Server-SQL;Database=database;Uid=user;Pwd=password;Encrypt=yes

The new 2018 undeprecated OLE DB driver is installed on both Server-1 and Server-2.

The registry keys that enable/disable encryption are set up the same on both servers. e.g.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client

When running the same C# code on Server-1 and Server-2, Server-1 connects to the database without issue but Server-2 throws out the following error message:

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. SQL Server Network Interfaces: No remote client protocols are enabled and no remote protocol was specified in the connection string [xFFFFFFFF].

With the following stack trace:

   at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection wningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OleDb.OleDbConnection.Open()
   at Squealer.Squealer.TryToConnectToDatabase(DatabaseConnectionInfo connectionInfo)
   at Squealer.Squealer.Run(String[] args)

I don't see any rules in the firewalls on either Server-1 or Server-2 that would prevent network traffic to Server-SQL.

WireShark captures traffic between Server-1 and Server-SQL like this: WireShark trace of SQL traffic

WireShark does not capture any traffic at all between Server-2 and Server-SQL when attempting to establish a SQL connection.

Network connectivity between Server-2 and Server-SQL has been established as follows: nslookup and ping results

The SQL Server is configured to allow TLS 1.1 and TLS 1.2. When it is configured to connect with TLS 1.1 the connection is successful.

I have compiled the .net code with both .net 4.6.2 and 4.7.0. Both servers have up to .net 4.7.0 installed.

Testing a UDL file that has Provider=MSOLEDBSQL.1 actually connects on both Servers.

In spite of extensive googling I've not found any trace of this particular error message so I have very little else to go on here..

Am I looking for a registry key that someone has mangled? I'm out of ideas.

Any help or light shed on this situation will be great-fully received.

Thank you.

rtev
  • 101
  • 2

0 Answers0