I currently have a project in production with legacy driver versions as mentioned below.
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.12.7'
compile group: 'org.mongodb', name: 'mongodb-driver-core', version: '3.12.7'
compile group: 'org.mongodb.morphia', name: 'morphia', version: '1.3.1'
Due to our recent upgrade to MongoDB 7.0 from 4, we need to upgrade the driver versions as well to a version below.
compile group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.1.0'
compile group: 'org.mongodb', name: 'mongodb-driver-legacy', version: '4.1.0'
compile group: 'dev.morphia.morphia', name: 'core', version: '1.6.1'
After upgrading my driver, I am having issues with SSL connection that didn’t occur with the previous version.
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@4dda0835. Client view of cluster state is {type=REPLICA_SET, servers=[{address=xxx:1024, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.h: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}, caused by {com.ibm.jsse2.util.h: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}, caused by {com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}}, {address=xxx:1025, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.h: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}, caused by {com.ibm.jsse2.util.h: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}, caused by {com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}}, {address=xxx:1026, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.h: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}, caused by {com.ibm.jsse2.util.h: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}, caused by {com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target}}]
Using Java version = 1.8.0_271