## Ruby 

The recent versions of the Ruby driver have support for connections to SSL servers. Install the latest version of the driver with the following command: 

gem install mongo 

Then connect to a standalone instance, using the following form: 

require 'rubygems' require 'mongo' connection = MongoClient. new ('localhost', 27017, :ssl => true ) 

Replace connection with the following if you’re connecting to a replica set: 

connection = MongoReplicaSetClient.new(['localhost:27017'], ['localhost:27018'], :ssl => true ) 

Here, mongod instance run on “ localhost:27017 ” and “ localhost:27018 ”. 

For more details, see the Ruby MongoDB Driver page$^{45}$. 

## Node.JS ( node-mongodb-native ) 

In the node-mongodb-native 46 driver, use the following invocation to connect to a mongod or mongos instance via SSL: 

var db1 = new Db(MONGODB, new Server("127.0.0.1", 27017, { auto_reconnect: false , poolSize:4, ssl: true } ); 

To connect to a replica set via SSL, use the following form: 

var replSet = new ReplSetServers( [ new Server( RS.host, RS.ports[1], { auto_reconnect: true } ), new Server( RS.host, RS.ports[0], { auto_reconnect: true } ), ], {rs_name:RS.name, ssl: true } ); 

For more details, see the Node.JS MongoDB Driver page$^{47}$. 

## .NET 

As of release 1.6, the .NET driver supports SSL connections with mongod and mongos instances. To connect using SSL, you must add an option to the connection string, specifying ssl=true as follows: 

var connectionString = "mongodb://localhost/?ssl=true"; var server = MongoServer.Create(connectionString); 

The .NET driver will validate the certificate against the local trusted certificate store, in addition to providing en- cryption of the server. This behavior may produce issues during testing if the server uses a self-signed certificate. If 

