Software⏱️ 3 min read📅 2026-06-04

How to Fix: 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

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

Quick Answer: Update the Microsoft JDBC Driver to version 9.2 or later, which supports TLS/SSL encryption.

The Microsoft JDBC Driver error 'The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption' occurs when connecting to a SQL Server database using Java 8. This issue affects applications that have recently upgraded from Java 6 and Java 7, running on SUSE Linux Enterprise with Java 8 installed.

This error can be frustrating as it prevents the application from establishing a connection to the database, resulting in errors or incomplete data retrieval. Fortunately, there are steps you can take to resolve this issue.

💡 Why You Are Getting This Error

  • The primary reason for this error is that the Microsoft JDBC Driver version used with Java 8 does not support SSL encryption by default. This means that the driver cannot establish a secure connection to the SQL Server database.
  • Another possible reason for this error is that the SQL Server instance has SSL encryption enabled, but the certificate is not properly configured or is missing in the system's trust store.

🛠️ Step-by-Step Verified Fixes

Enable SSL/TLS encryption using the Microsoft JDBC Driver

  1. Step 1: Step 1: Download and install the latest version of the Microsoft JDBC Driver for SQL Server from the official Microsoft website. Ensure that you select the 'SSL' or 'TLS' option during installation to enable secure connection support.
  2. Step 2: Step 2: Update the system's trust store to include the SSL/TLS certificate used by the SQL Server instance. You can do this by adding the certificate to the Java KeyStore and updating the system's keystore configuration.
  3. Step 3: Step 3: Configure the Microsoft JDBC Driver to use the SSL/TLS encryption settings. This may involve setting environment variables, modifying the driver's properties, or using a connection string with the 'ssl' option.

Use an alternative JDBC driver that supports SSL/TLS encryption

  1. Step 1: Step 1: Download and install an alternative JDBC driver that supports SSL/TLS encryption, such as the SQL Server JDBC Driver (mssql-jdbc) version 9.2 or later.
  2. Step 2: Step 2: Update the application's configuration to use the new JDBC driver instead of the Microsoft JDBC Driver. This may involve modifying connection strings, environment variables, or driver properties.

💡 Conclusion

By following these steps, you should be able to resolve the 'The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption' error and establish a secure connection to your SQL Server database using Java 8.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions