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:
Hello, I am using dockerized version of Liquibase to connect to my local DB server and I am getting connection issues. However I am able to connect to this server using other clients like Dbeaver and sqlcmd. Below is the command I used.
Unexpected error running Liquibase: Connection could not be created to jdbc:sqlserver://127.0.0.1:14339;databaseName=master;encrypt=true;trustServerCertificate=true with driver com.microsoft.sqlserver.jdbc.SQLServerDriver. The TCP/IP connection to the host 127.0.0.1, port 14339 has failed. Error: "Connection refused. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".