Q:

mongodb atlas connection issues with ssl

I've created a cluster using mongodb atlas. But, I couldn't connect to that using local mongo shell.
When I use the below connection string, it says --ssl unrecognized.
Harshavardhans-MacBook-Pro:bin harshavmb$ mongo "mongodb://m123-rs1-shard-00-00-wn1jr.mongodb.net:27017,m123-rs1-shard-00-01-wn1jr.mongodb.net:27017,m123-rs1-shard-00-02-wn1jr.mongodb.net:27017/test?replicaSet=m123-rs1-shard-0" --authenticationDatabase admin --ssl --username mongoadmin --password *****

Error parsing command line: unrecognised option '--ssl'
try 'mongo --help' for more information
If I remove --ssl and try, I see the below o/p.
Harshavardhans-MacBook-Pro:bin harshavmb$ mongo "mongodb://m123-rs1-shard-00-00-wn1jr.mongodb.net:27017,m123-rs1-shard-00-01-wn1jr.mongodb.net:27017,m123-rs1-shard-00-02-wn1jr.mongodb.net:27017/test?replicaSet=m123-rs1-shard-0" --authenticationDatabase admin --username mongoadmin --password ****
MongoDB shell version: 3.2.10
connecting to: mongodb://m123-rs1-shard-00-00-wn1jr.mongodb.net:27017,m123-rs1-shard-00-01-wn1jr.mongodb.net:27017,m123-rs1-shard-00-02-wn1jr.mongodb.net:27017/test?replicaSet=m123-rs1-shard-0
2017-03-18T14:19:00.820+0530 I NETWORK  [thread1] Starting new replica set monitor for m123-rs1-shard-0/m123-rs1-shard-00-00-wn1jr.mongodb.net:27017,m123-rs1-shard-00-01-wn1jr.mongodb.net:27017,m123-rs1-shard-00-02-wn1jr.mongodb.net:27017
2017-03-18T14:19:00.820+0530 I NETWORK  [ReplicaSetMonitorWatcher] starting
2017-03-18T14:19:06.255+0530 I NETWORK  [thread1] Socket recv() timeout  35.167.185.140:27017
2017-03-18T14:19:06.258+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_TIMEOUT] server [35.167.185.140:27017] 
2017-03-18T14:19:07.040+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.95.185:27017
2017-03-18T14:19:07.040+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.95.185:27017] 
2017-03-18T14:19:07.757+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.83.174:27017
2017-03-18T14:19:07.757+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.83.174:27017] 
2017-03-18T14:19:07.757+0530 W NETWORK  [thread1] No primary detected for set m123-rs1-shard-0
2017-03-18T14:19:08.985+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.95.185:27017
2017-03-18T14:19:08.985+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.95.185:27017] 
2017-03-18T14:19:09.702+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.83.174:27017
2017-03-18T14:19:09.702+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.83.174:27017] 
2017-03-18T14:19:10.419+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.167.185.140:27017
2017-03-18T14:19:10.419+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.167.185.140:27017] 
2017-03-18T14:19:10.419+0530 W NETWORK  [thread1] No primary detected for set m123-rs1-shard-0
2017-03-18T14:19:11.648+0530 I NETWORK  [ReplicaSetMonitorWatcher] Socket recv() errno:54 Connection reset by peer 35.162.95.185:27017
2017-03-18T14:19:11.648+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.167.185.140:27017
2017-03-18T14:19:11.648+0530 I NETWORK  [ReplicaSetMonitorWatcher] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.95.185:27017] 
2017-03-18T14:19:11.648+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.167.185.140:27017] 
2017-03-18T14:19:12.364+0530 I NETWORK  [ReplicaSetMonitorWatcher] Socket recv() errno:54 Connection reset by peer 35.162.83.174:27017
2017-03-18T14:19:12.365+0530 I NETWORK  [ReplicaSetMonitorWatcher] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.83.174:27017] 
2017-03-18T14:19:12.365+0530 W NETWORK  [ReplicaSetMonitorWatcher] No primary detected for set m123-rs1-shard-0
2017-03-18T14:19:14.731+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.83.174:27017
2017-03-18T14:19:14.731+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.83.174:27017] 
2017-03-18T14:19:14.731+0530 W NETWORK  [thread1] No primary detected for set m123-rs1-shard-0
2017-03-18T14:19:15.845+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.95.185:27017
2017-03-18T14:19:15.845+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.95.185:27017] 
2017-03-18T14:19:16.563+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.167.185.140:27017
2017-03-18T14:19:16.563+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.167.185.140:27017] 
2017-03-18T14:19:17.176+0530 I NETWORK  [thread1] Socket recv() errno:54 Connection reset by peer 35.162.83.174:27017
2017-03-18T14:19:17.177+0530 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [35.162.83.174:27017] 
2017-03-18T14:19:17.177+0530 W NETWORK  [thread1] No primary detected for set m123-rs1-shard-0
2017-03-18T14:19:17.181+0530 E QUERY    [thread1] Error: connect failed to replica set m123-rs1-shard-0/m123-rs1-shard-00-00-wn1jr.mongodb.net:27017,m123-rs1-shard-00-01-wn1jr.mongodb.net:27017,m123-rs1-shard-00-02-wn1jr.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:223:14
@(connect):1:6

exception: connect failed

Interestingly, I was able to connect to the cluster with java driver. Only shell has this problem.
Have googled a lot to find fix this ssl issue, but couldn't find any helpful link.
Any help would be highly appreciated.
Thanks in advance. 

A:

I had copied Mongo 3.2 binaries to /usr/local/bin directory, so this wasn't allowing newer version of mongo binaries (3.4). So, eventually I had to remove the binaries from /usr/local/bin directory and paste the binaries of 3.4 and this fixed the ssl issue.

