jdbcdb2liquibaseliquibase-hibernatedb2-woc

How to use liquibase cmd with db2 ssl connection?


I'm trying to run liquibase update command using

liquibase --driver="com.ibm.db2.jcc.DB2Driver" --changeLogFile="masterchangelog.xml " --url="jdbc:db2://localhost:60001/SMDINTDB:retrieveMessageFromServerOnGetMessage=true;sslConnection=true;"  --username="" --password="" --classpath=/home/db2inst1/sqllib/java/db2jcc4.jar validate

But I'm getting following error. Can anyone help me how to resolve this issue? How I can specify the location of certs ?

Unexpected error running Liquibase: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][4.26.14] A communication error occurred during operations on the connection's underlying socket, socket input stream,
or socket output stream.  Error location: Reply.fill() - socketInputStream.read (-1).  Message: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. ERRORCODE=-4499, SQLSTATE=08001

Solution

  • Several pre-requisites exist for on-premises Db2-LUW SSL connectivity with jdbc. liquibase works correctly with SSL connections to on-premises Db2-LUW, if all the prerequisite configuration completed successfully. Here are some tips.