I\'m using Java 11 (Maven project) for mongodb Free Tier Cluster (Version 4.0.13). I\'m trying to connect via connection-string (for 3.6 drivers or later) like:
Java 8
I've changed Java 11 to Java 8 and it solved the issue. Looks like Java 11 doesn't support SNI. Because all attempts were unsuccessful despite the fact that I used the latest drivers.
Java 11
Thanks to clarification by Virg, I've changed version of Java 11, but also the license. I had Java 11 using Java Development Kit builds (from Oracle) - as sourse. Then I've installed another license as Azulu using JDK version 11.0.5+10 and it also solved the error.
I had the same issue using a Docker image from adoptopenjdk/openjdk11-openj9:jdk-11.0.1.13-alpine-slim
. Since I've upgraded to adoptopenjdk/openjdk11-openj9:jdk-11.0.5.10-alpine-slim
, my connection to MongoDB is OK.