0

I am trying to integrate MongoDB with hazelcast for distributed caching. The MongoDB has cluster servers and requires a password. When i do a get collection call in the MongoMapStore.java class following the example mentioned in

https://github.com/hazelcast/hazelcast-code-samples/blob/master/hazelcast-integration/mongodb/src/main/java/com/hazelcast/loader/MongoMapStore.java. I get errors such as

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: >PKIX path building failed:

sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

etc. If it helps I could produce the entire stacktrace of the errors.

How can I solve this issue.

Antho Christen
  • 1,369
  • 1
  • 10
  • 21
arrhhh
  • 99
  • 2
  • 16
  • Enusre your keystore has the required cetificates. If you do have a the server's public key cert and want to load it, check https://stackoverflow.com/questions/4325263/how-to-import-a-cer-certificate-into-a-java-keystore. Also, when is this `SSLHandshakeException` occur, while establishing connection with the mongo server? – Antho Christen May 23 '18 at 06:12
  • 1
    adding the certificate did it maybe you can post it as an answer and I will accept it – arrhhh May 23 '18 at 06:22

1 Answers1

0

The error is likely due to a missing Certificate for your DB Server. Ensure your keystore has the required certificate(s). If you do have a the server's public key cert and want to load it, check,

How to import a .cer certificate into a java keystore?

Antho Christen
  • 1,369
  • 1
  • 10
  • 21