diff --git a/source/administration/ssl.txt b/source/administration/ssl.txt index 75ca47aea02..f6188048f75 100644 --- a/source/administration/ssl.txt +++ b/source/administration/ssl.txt @@ -94,13 +94,25 @@ information about MMS configuration. PyMongo ~~~~~~~ -Add the "``ssl=true`` parameter to a PyMongo connection to create a +Add the "``ssl=True``" parameter to a PyMongo connection to create a MongoDB connection to an SSL MongoDB instance: .. code-block:: python from pymongo import Connection - c = Connection( host="mongodb.example.net", port=27017, ssl=True ) + c = Connection(host="mongodb.example.net", port=27017, ssl=True) + +Do the following if you're connecting to a replica set: + +.. code-block:: python + + from pymongo import ReplicaSetConnection + c = ReplicaSetConnection("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 Java ~~~~ @@ -184,4 +196,4 @@ To connect to a replica set via SSL, use the following form: {rs_name:RS.name, ssl:ssl} ); -.. _`node-mongodb-native1`: https://github.com/mongodb/node-mongodb-native +.. _`node-mongodb-native`: https://github.com/mongodb/node-mongodb-native