title: .NET 4.5 forms app connecting to SQL Server 2012 fails: SSL Provider, error: 0
body: <p>I have a problem connection to a SQL Server 2012 instance running on Windows Server 2012. I have a .NET 4.5 windows forms application installed on a client machine running Windows 7. The error I get is this:</p>
  
  <pre><code>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.)
  </code></pre>
  
  <p>My connection string looks like this:</p>
  
  <pre><code>server=SERVERNAME;database=DATABASENAME;User Id=someuser;password=somepassword;Timeout=60;app=LabelMaker
  </code></pre>
  
  <p>I tried connecting to the SQL Server from the client machine using <a href="http://www.albahari.com/queryexpress.aspx">QueryExpress</a>
  and that worked! My app is 64-bit if that is of any help. I've checked every setting I can think of in SQL Server. No force encryptions are enabled on the protocols (shared memory and tcp/ip), the domain firewall is open on the server. I've tried various connection strings with all kinds of unheard off parameters, always the same result, failure. </p>
  
  <p>I'm really confused about why it works with QueryExpress? My app works when connected to a remote instance of SQL SERVER Express on another machine, it also works if I run it on the SQL Server 2012 machine. </p>
  
  <p>I've also tried connecting to the server from the client machine with <a href="http://www.linqpad.net/">LinqPad</a> and this is also really weird, with the new version based on net4/4.5 (Version: 4.43.06) it fails but when I use the old version of Linqpad (2.x) based on net3.5 it works!</p>
  
  <p>It seems like Panda Security is causing the problem, I ran</p>
  
  <pre><code>netsh winsock show catalog 
  </code></pre>
  
  <p>and found a few panda entries, I then did a reset</p>
  
  <pre><code>netsh winsock reset
  </code></pre>
  
  <p>now my application works fine, I then rebooted the machine, ran the catalog command again,
  the panda entries were back and my app is having the same problem as before.</p>
  
  <p>Here are the Panda entries in the winsock catalogue: <a href="https://gist.github.com/pellehenriksson/5159883">https://gist.github.com/pellehenriksson/5159883</a></p>
  
  <p>All ideas and suggestions are appreciated.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Panda Security v5 is the cause of this problem, this has been confirmed by Panda support.
  The root cause of the problem is explained by Alex below. The customer will do an upgrade to v6 of Panda Security, I will test again after the upgrade.</p>
  
  <p><strong>CONCLUSION</strong>
  Moving to Panda Security v6.0 fixed this issue.</p>