title: An error occurred during the pre-login handshake
body: <p>After a few years of development my C#/.Net program is having this issue while attempting to connect to a MS Sql server database. I have no idea on how I can fix it. It's occuring only when attempting to write on a specific table. After clearing that table I noticed a decreased frenquency of this issue but it's still happening from time to time;</p>
  
  <p>Here are the two exceptions I get :</p>
  
  <ol>
  <li><blockquote>
    <p>System.Data.SqlClient.SqlException (0x80131904): 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.) ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out  at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) ... at System.Data.Linq.DataQuery<code>1.System.Linq.IQueryProvider.Execute[S](Expression &gt;expression)  at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable</code>1 source) </p>
  </blockquote></li>
  </ol>
  
  <p>2.</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=42511; handshake=6001; ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out 
    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) 
    ...</p>
  </blockquote>