com.mongodb.MongoSocketWriteException: Exception sending message
Caused by: javax.net.ssl.SSLException: Received fatal alert:
internal_error
While trying to connect mongodb using Springboot getting error
MongoSocketWriteExcepption caused by javax.net.ssl.sslexception
2
Answers
If you are connecting to atlas cluster on cloud, you can take a look at your ip address again, if your current ip address is added to the access list under Network Access option. So, on Atlas home page, in left bar, you will see Security –> network access –> ip access list –> Add current ip address.
Hope it helps!!
Make sure you are importing the provided .pem file to your JRE cacerts which is a certificate provided by MongoDB server.
The certificate need to be imported to ${java_home}/jre/lib/security/cacerts
using the command
keytool -import -trustcacerts -file testCA.pem -keystore cacerts -storepass "changeit"
Also, make sure you are using right JRE while executing your code where the .pem certificate was exported.