The server certificate does not match the host name

Hi Team,

I’ve deployed the MongoDB Kubernetes Operator v1.9.2 and deployed the Ops Manager v 4.4.7 and database Replicaset v4.4.0.

I’ve configured the ReplicaSet with TLS enabled.

Able to connect to database via mongo-0.mongo-svc.mongodb.svc.cluster.local and also via my Organizations DNS xx-xxxx.xxxx.xxxxx.com Here the connection is happening via both the way via my Organizations DNS and via the mongo-0.mongo-svc.mongodb.svc.cluster.local

But getting some errors:

{"logType":"mongodb","contents":"{\"t\":{\"$date\":\"2021-04-19T06:32:42.788+00:00\"},\"s\":\"I\",  \"c\":\"NETWORK\",  \"id\":22944,   \"ctx\":\"conn5578\",\"msg\":\"connection ended\",\"attr\":{\"remote\":\"192.168.20.9:54636\",\"connectionCount\":5}}"}
{"logType":"mongodb","contents":"{\"t\":{\"$date\":\"2021-04-19T06:32:42.788+00:00\"},\"s\":\"I\",  \"c\":\"-\",        \"id\":4333222, \"ctx\":\"ReplicaSetMonitor-TaskExecutor\",\"msg\":\"RSM received failed isMaster\",\"attr\":{\"host\":\"mongo-0.mongo-svc.mongodb.svc.cluster.local:27017\",\"error\":\"HostUnreachable: Error connecting to mongo-0.mongo-svc.mongodb.svc.cluster.local:27017 (192.168.20.9:27017) :: caused by :: The server certificate does not match the host name. Hostname: mongo-0.mongo-svc.mongodb.svc.cluster.local does not match SAN(s): xxx-xxxxx.xxxxx.xxx.com, xxxx.xxxxx.xxxxx.com, CN: xxx.xxxxxx.xxxxx.com\",\"replicaSet\":\"mongo\",\"isMasterReply\":\"{}\"}}"}
{"logType":"mongodb","contents":"{\"t\":{\"$date\":\"2021-04-19T06:32:42.788+00:00\"},\"s\":\"I\",  \"c\":\"NETWORK\",  \"id\":4712102, \"ctx\":\"ReplicaSetMonitor-TaskExecutor\",\"msg\":\"Host failed in replica set\",\"attr\":{\"replicaSet\":\"mongo\",\"host\":\"mongo-0.mongo-svc.mongodb.svc.cluster.local:27017\",\"error\":{\"code\":6,\"codeName\":\"HostUnreachable\",\"errmsg\":\"Error connecting to mongo-0.mongo-svc.mongodb.svc.cluster.local:27017 (192.168.20.9:27017) :: caused by :: The server certificate does not match the host name. Hostname: mongo-0.mongo-svc.mongodb.svc.cluster.local does not match SAN(s): xxxx.xxxxxx.xxxxxxx.com, xxxx.xxxxxxx.xxxxx.com, CN: xxxx.xxxxxxx.xxxxxxx.com\"},\"action\":{\"dropConnections\":true,\"requestImmediateCheck\":false,\"outcome\":{\"host\":\"mongo-0.mongo-svc.mongodb.svc.cluster.local:27017\",\"success\":false,\"errorMessage\":\"HostUnreachable: Error connecting to mongo-0.mongo-svc.mongodb.svc.cluster.local:27017 (192.168.20.9:27017) :: caused by :: The server certificate does not match the host name. Hostname: mongo-0.mongo-svc.mongodb.svc.cluster.local does not match SAN(s): xxx.xxxxxxx.xxxxxxx.com, xxxx.xxxxxx.xxxxx.com, CN: xxxx.xxxxxxx.xxxxxx.com\"}}}}"}

This kind of error I’m getting and able to insert the data from Mongo Shell 4.4.0, but from Ops Manager UI unable to Insert the data.