Unexpected error running Liquibase: Connection could not be created to jdbc:sqlserver://localhost:1433;databaseName=test;integratedSecurity=false; with driver com.microsoft.sqlserver.jdbc.SQLServerDriver. 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”. ClientConnectionId:6c1ec0cc-b5ff-4e56-b1fb-ce77390d4fe6
I’m not really familiar withsql-server, but that doesn’t look like a Liquibase specific error, just a sql-server connection issue, missing a cert for connecting. You should make sure you can connect to the sql-server outside of Liquibase before trying to use Liquibase.
Try removing integratedSecurity=false and adding encrypt=false to test connectivity.
I did some searching and was able to find an article on the Atlassian website that referenced a similar error. This is the fix they suggested:
If -Djavax.net.ssl.trustStore is present in your JVM arguments, Java will use the truststore configured instead of the default (cacerts). You can verify whether the -Djavax.net.ssl.trustStore parameter is causing problems by running the SSLPoke test using the same JVM argument which will execute SSLPoke using your custom truststore. For example: