MongoDB Documentation, Release 3.0.4 See the MongoDB Cloud Manager documentation 40 for more information about SSL configuration. For Ops Manager, see Ops Manager documentation$^{41}$. Add the “ ssl=True ” parameter to a PyMongo MongoClient 42 to create a MongoDB connection to an SSL Mon- goDB instance: PyMongo Consider the following example “ SSLApp.java ” class file: Java from pymongo import MongoReplicaSetClient c = MongoReplicaSetClient("mongodb.example.net:27017", replicaSet="mysetname", ssl=True) from pymongo import MongoClient c = MongoClient(host="mongodb.example.net", port=27017, ssl=True) To connect to a replica set, use the following operation: 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}$. 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}$. $^{40}$https://docs.cloud.mongodb.com/ $^{41}$https://docs.opsmanager.mongodb.com/current $^{42}$http://api.mongodb.org/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient $^{43}$https://docs.mongodb.org/ecosystem/drivers/python $^{44}$https://docs.mongodb.org/ecosystem/drivers/java Chapter 6. Security 348