Connection to Microsoft SQL Server instance fails with SSL-related issue even though the server instance is not configured to force encryption

Connection to Microsoft SQL Server instance fails with SSL-related issue even though the server instance is not configured to force encryption

book

Article ID: KB0137469

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 5.x

Description

When using Microsoft JDBC Driver for SQL Server, connection to DB Server instance fails with SSL-related issue even though the server instance is not configured to force encryption. The following exception is encountered.

com.microsoft.sqlserver.jdbc.SQLServerException: "encrypt" property is set to "true" and "trustServerCertificate" property is set to "false" but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Since version 10.2, Microsoft JDBC Driver for SQL Server has encryption enabled by default.So if the driver is not configured for encryption, connection attempt fails.

Environment

TIBCO ActiveMatrix BusinessWorks™ 5.x

Microsoft JDBC Driver for SQL Server 10.2 or higher

Resolution

If encryption is not required, it needs to be disabled explicitly by setting the connection property encrypt to false.

jdbc:sqlserver://host:port;databaseName=database;encrypt=false

Issue/Introduction

Connection to Microsoft SQL Server instance fails with SSL-related issue even though the server instance is not configured to force encryption