.NET Application 4.5 forms connecting to SQL Server 2012 does not work: SSL provider, error: 0

I had a problem connecting to an instance of SQL Server 2012 running on Windows Server 2012. I have a Windows Forms.NET 4.5 application installed on a client machine running Windows 7. The error I am getting is this:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.) 

My connection string looks like this:

 server=SERVERNAME;database=DATABASENAME;User Id=someuser;password=somepassword;Timeout=60;app=LabelMaker 

I tried connecting to SQL Server from the client machine using QueryExpress and it worked! My application is 64 bit if that helps. I checked all the parameters that I can imagine in SQL Server. In the protocols (shared memory and tcp / ip), forced encryption is not enabled, the domain firewall is open on the server. I tried different connection strings with all kinds of unheard of parameters, always the same result, failure.

I'm really confused about why it works with QueryExpress? My application works when connected to a remote instance of SQL SERVER Express on another computer, it also works if I run it on a SQL Server 2012 machine.

I also tried to connect to the server from the client machine with LinqPad , and this is also very strange, with the new version based on net4 / 4.5 (Version: 4.43.06) it does not work, but when I use the old version of Linqpad (2.x) based on net3.5, it works!

It seems that Panda Security is causing the problem, I ran

 netsh winsock show catalog 

and found some Panda entries, then I reset

 netsh winsock reset 

now my application works fine, I rebooted the machine, ran the directory command again, the Panda entries were returned, and my application had the same problem as before.

The following are the Panda entries in the winsock directory: https://gist.github.com/pellehenriksson/5159883

All ideas and suggestions are welcome.

UPDATE

Panda v5 security issue is the cause of this problem, as confirmed by Panda support. The root cause of the problem is explained by Alex below. The client will upgrade to Panda version v670>, after testing I will check again.

Conclusion Moving to Panda Security v6.0 has fixed this problem.

+9
sql-server-2012
source share
3 answers

This seems like a non-Microsoft issue: The beta version of Visual Studio 11 disabled my ability to connect to a remote MS SQL Server, but not to local databases .

The ticket was closed as external .

The only workaround currently available on Microsoft Connect is:

Posted by Lars Joachim Nilsson on 04/4/2012 at 5:03

My car had this problem. The job for me was to remove the Winsock directory provider other than IFS LSP. Se http://support.microsoft.com/kb/2568167 / Lars Nilsson

The SetFileCompletionNotificationModes API causes the I / O completion port to work incorrectly with non-IFS LSPs installed . This gives permission:

Do not specify the FILE_SKIP_COMPLETION_PORT_ON_SUCCESS flag or remove any IFS-incompatible Winsock LSPs. In addition, moving from non-IFS LSP to the Windows Filter Platform (WFP) can solve this problem.

So, you should remove Panda Security or, alternatively, you can try to execute netsh winsock reset as a pre-build command (although I'm not sure if this is effective without rebooting) , which will allow you to develop / debug your application.

[UPDATE]

For more information about application compatibility, see: Application Compatibility in the .NET Framework 4.5 :

Data

SQLClient

Function

The ability to connect to a SQL Server database from managed code that runs under the .NET Framework 4.5.

Edit

The existing synchronous API code path has been modified to add asynchronous support.

Impact

The presence of Winsock non-IFS (BSP) basic service providers or layered service providers (LSPs) may prevent you from connecting to SQL Server . For more information, see the SetFileCompletionNotificationModes API that causes the I / O completion port to not work correctly with the non-IFS LSP installed on the Microsoft Support Web site.

+6
source share

I'm sorry to say this, but rebooting Visual Studio and my Microsoft SQL Server Management Studio solved this problem.

+2
source share

Good old car reboot :) :) :)

-one
source share

All Articles