[SOLVED] SSL connection error in MongoDB shell

Hello I’m getting this error when trying to log in according to the instructions in the video
Shell version v4.0.5

Summary

mongo mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0 --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
MongoDB shell version v4.0.5
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0
2019-01-21T10:48:45.573+0100 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-01-21T10:49:01.081+0100 E NETWORK [ReplicaSetMonitor-TaskExecutor] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-01-21T10:49:01.084+0100 E NETWORK [ReplicaSetMonitor-TaskExecutor] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-01-21T10:49:01.114+0100 E NETWORK [js] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-01-21T10:49:01.115+0100 E NETWORK [js] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-01-21T10:49:01.600+0100 E NETWORK [ReplicaSetMonitor-TaskExecutor] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-01-21T10:49:01.601+0100 E NETWORK [ReplicaSetMonitor-TaskExecutor] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-01-21T10:49:01.602+0100 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set Cluster0-shard-0
2019-01-21T10:49:01.604+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2019-01-21T10:49:01.604+0100 E QUERY [js] Error: connect failed to replica set Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

I am able to login with the command you gave.No issues
Please check while pasting if any space/junk characters came

vagrant@m103:/dataset$ mongo mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0 --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
MongoDB shell version v3.6.9
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0

MongoDB server version: 3.6.9
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db
test
MongoDB Enterprise Cluster0-shard-0:PRIMARY> use admin
switched to db admin
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show dbs
100YWeatherSmall 0.128GB

my version is 4.0.5 could this be the issue? Does 3.6.9 have different syntax than 4.0.5 ?

Apparently when using --ssl you also have to use the --host option
"https://stackoverflow.com/questions/41635371/mongodb-self-signed-ssl-connection-ssl-peer-certificate-validation-failed

managed to connect to the cluster with this command

mongo --ssl --host mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/?replicaSet=Cluster0-shard-0 --authenticationDatabase admin --username m001-student --password m001-mongodb-basics