SAC - Unable to connect to data source (SSL: unable to find valid certification path to requested target)

This error occurs while trying to save a new data connection in SAC. This is because SAC Cloud Agent encountered an issue while trying to connect to the specified MSSQL database as the database could not be found.

Remediation

Note: This is a workaround for testing purposes.
This is NOT recommended for production / live systems.
This is ONLY for MS SQL databases.

  1. In the server where SAC Cloud Agent is installed, open the Apache Tomcat's error logs and you would see error messages similar to this:

     15-Feb-2023 17:30:01.162 SEVERE [http-nio-8080-exec-5] com.sap.fpa.cloud.rest.cs.service.ValidateLogonService.null CID[xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx] TID[xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx] The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
         com.sap.connectivity.cs.java.drivers.DBDError: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    
  2. In SAC's new data connection pop-up page, under 'Connection string parameters', add the following:

     'encrypt=true;trustServerCertificate=true'.
    

  3. Now, the new data connection should be able to save successfully.

References

If you like what I wrote, please support me here! %%[ko-fi]

Did you find this article valuable?

Support Nyan Fu Keong by becoming a sponsor. Any amount is appreciated!