title: How do I fix an error connecting to SQL Server: SSL Provider, error: 0 - The message received was unexpected or badly formatted
body: <p>When connecting from my local dev box using Visual Studio 2012 (or 2013) against a SQL Server 2008R2 SP1, I get this message: </p>
  
  <blockquote>
    <p>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.)</p>
  </blockquote>
  
  <p>My version of .Net framework locally is 4.5.50938</p>
  
  <p>My colleague has the exact same problem. I also believe I had the problem earlier, before re-installing the pc, when I had SSMS 2012 installed, as that also relies on .Net framework 4, not .Net v2 as SSMS2008R2, which works fine. It would also make sense, that the internal data tooling in visual studio relies on .Net 4.</p>
  
  <p>The problem has not always been there, and I believe it was introduced when I first installed Visual Studio 2013 - and then again later after a reinstall, most likely after updating the .Net framework.</p>
  
  <p>The problem seems to me to be related to System.Data in this version of the .Net framework, when connecting against a SQL Server 2008R2 SP1. </p>
  
  <p>How can I fix this? Are there any known fixes, updates etc?</p>
  
  <p>Unfortunately updating SQL Server 2008R2SP1 is not currently an option.</p>
  
  <p>I have also searched for solutions, but have found nothing usable, so far. Here are a couple of links to other posts with similar issue:</p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/ea2c470f-14ba-4864-8a39-1396f4e361e8/sqlconnection-now-failing-exception-when-connecting-to-remote-instance?forum=sqldataaccess" rel="noreferrer">http://social.msdn.microsoft.com/Forums/en-US/ea2c470f-14ba-4864-8a39-1396f4e361e8/sqlconnection-now-failing-exception-when-connecting-to-remote-instance?forum=sqldataaccess</a></p>
  
  <p><a href="http://www.sqlservercentral.com/Forums/Topic1529609-2799-1.aspx" rel="noreferrer">http://www.sqlservercentral.com/Forums/Topic1529609-2799-1.aspx</a></p>
  
  <p><img src="https://i.stack.imgur.com/204Hs.png" alt="enter image description here"></p>