When TrustServerCertificate is set to true, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. As a quick workaround, if you enable TrustServerCertificate=True in the connection string, the connection from JDBC succeeds. This is an issue in Java Certificate Store. "SQLServerException: Failed to authenticate the user in Active Directory (Authentication=ActiveDirectoryPassword).Ĭaused by: ExecutionException: mssql_.adal4j.AuthenticationException: PKIX path building failed: .SunCertPathBuilderException: unable to find valid certification path to requested targetĬaused by: AuthenticationException: PKIX path building failed: .SunCertPathBuilderException: unable to find valid certification path to requested target. The article presents the steps to import required certificates and enable Java application to connect to Azure SQL DB/Managed Instance. If required certificates are missing on client machine when connecting via AAD authentication, a similar error will be prompted in the application logs: