title: SQL Server JDBC Error on Java 8: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption
body: <p>I am getting the following error when connecting to a SQL Server database using version the Microsoft JDBC Driver:</p>
  
  <blockquote>
    <p>com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response. The connection has been closed. ClientConnectionId:98d0b6f4-f3ca-4683-939e-7c0a0fca5931".</p>
  </blockquote>
  
  <p>We recently upgraded our applications from Java 6 &amp; Java 7 to Java 8.  All systems running Java are running SUSE Linux Enterprise Server 11 (x86_64), VERSION = 11, PATCHLEVEL = 3.</p>
  
  <p>Here are the facts I have collected with a Java program that I wrote which simply sequentially opens and closes 1,000 database connections.</p>
  
  <ul>
  <li>Connections are dropped with this error about 5%-10% of the time.  The error DOES NOT occur on every connection.</li>
  <li>The problem ONLY occurs with Java 8.  I ran the same program on Java 7 and the problem is not reproducible.  This is consistent with our experience in production prior to upgrading.  We've had zero problems running under Java 7 in production.</li>
  <li>The problem DOES NOT occur on all of our Linux servers running Java 8, it only occurs on some of them.  This is perplexing to me, but when I run the same test program on the same version of the Linux JVM (1.8.0_60, 64 bit) on different Linux instances, the problem does not occur on one of the Linux instances, but the problem does occur on others.  The Linux instances are running the same version of SUSE and they are at the same patch level.</li>
  <li>The problem occurs when connecting to BOTH SQL Server 2008 and SQL Server 2014 servers/databases.</li>
  <li>The problem occurs regardless if I am using the 4.0 version of the SQL Server JDBC driver or the newer 4.1 version of the driver.</li>
  </ul>
  
  <p>The thing that makes my observations unique on this compared to others on the web is that although the problem happens ONLY on Java 8, I cannot get the problem to occur on one of the seemingly identical Linux servers that is running the same Java 8 JVM.  Other folks have seen this problem on earlier versions of Java as well, but that has not been our experience.</p>
  
  <p>Any input, suggestions, or observations you may have are appreciated.</p>