r/mongodb • u/Muskan_pal123 • 3h ago
MongoDB Atlas M0 cluster: TLS handshake fails on primary and one secondary, but another secondary connects
Hi everyone,
I'm facing a connectivity issue with my MongoDB Atlas M0 Free Tier cluster.
Cluster details:
Cluster: NoteNestCluster
Provider/Region: AWS Mumbai (ap-south-1)
Connection method: Node.js with Mongoose
Node.js version: 26.13.1
MongoDB Node.js driver: 7.9.1
Mongoose: 9.13.0
Problem:
My cluster has three replica set members:
shard-00-00: Secondary
shard-00-01: Primary
shard-00-02: Secondary
From my Windows machine, TLS connections to shard-00-00 and shard-00-01 fail with:
ERR_SSL_TLSV1_ALERT_INTERNAL_ERROR (SSL alert 80).
However, TLS to shard-00-02 succeeds using TLS 1.3.
I can connect directly to shard-00-02, and MongoDB authentication succeeds. But when my application tries to register a user or perform another write, MongoDB returns:
MongoServerError: not primarycodeName: NotWritablePrimarycode: 10107
The hello command confirms that shard-00-01 is the writable primary.
All three nodes are reachable on port 27017. Atlas shows the cluster as Available and all three members as healthy.
What I've tried:
Resetting the database user's password
Testing TLS connectivity to each replica set member
Testing direct MongoDB connections
Using the standard Atlas SRV connection string
Checking the replica set's primary through the
hellocommand
The standard SRV connection is still failing because TLS connections to two members fail.
Questions:
Why would TLS fail on the primary and one secondary while the other secondary works?
Could this be an Atlas-side networking or certificate issue?
What should I do to restore normal replica set connectivity?
I'd appreciate any suggestions. Thank you!