Opening a SqlConnection now broken - multiple exceptions when using TCP
Posted on 2013-10-24
I've run into a problem where not too long ago, something like this would work just fine from app code:
using (var conn = new SqlConnection("Data Source=sqlinstance;Database=work;User ID=sa;Password=*****"))
Now when I do this for a remote instance, I get an exception right on the Open:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The message received was unexpected or badly formatted.)
(as best I can tell, running locally it's using Shared Memory, running remotely it's using TCP)
I was about to blame changes at my client (network/VPN) but I can get this problem now from anywhere connecting to a Windows Azure VM with a SQL instance as well (also know it previously worked).
I did do some software installs not long ago, but in all cases have removed them (VS 2013 with .NET 4.5.1, Microsoft Monitoring Agent - never fully installed anyway, Microsoft Message Analyzer), and also tried repairs against various components to no avail.
Hitting Continue in the debugger, I get a subsequent "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." and continuing again, "The connection was not closed. The connection's current state is connecting." which is what ultimately presents in the exception handler.
Something has clearly become broken but I'm kind of at a loss of where I should look next.