See the MongoDB Cloud Manager documentation 40 for more information about SSL configuration. 

For Ops Manager, see Ops Manager documentation$^{41}$. 

## PyMongo 

Add the “ ssl=True ” parameter to a PyMongo MongoClient 42 to create a MongoDB connection to an SSL Mon- goDB instance: 

from pymongo import MongoClient c = MongoClient(host="mongodb.example.net", port=27017, ssl=True) 

To connect to a replica set, use the following operation: 

from pymongo import MongoReplicaSetClient c = MongoReplicaSetClient("mongodb.example.net:27017", replicaSet="mysetname", ssl=True) 

PyMongo also supports an “ ssl=true ” option for the MongoDB URI : 

mongodb://mongodb.example.net:27017/?ssl=true 

For more details, see the Python MongoDB Driver page$^{43}$. 

## Java 

Consider the following example “ SSLApp.java ” class file: 

import com.mongodb. * ; import javax.net.ssl.SSLSocketFactory ; public class SSLApp { public static void main(String args[]) throws Exception { MongoClientOptions o = new MongoClientOptions.Builder() .socketFactory(SSLSocketFactory.getDefault()) .build(); MongoClient m = new MongoClient("localhost", o); DB db = m.getDB( "test" ); DBCollection c = db.getCollection( "foo" ); System.out.println( c.findOne() ); } } 

For more details, see the Java MongoDB Driver page$^{44}$. 

