From e04ccd037d5002eada92a0ed67e4d6dbaae57c92 Mon Sep 17 00:00:00 2001 From: behackett Date: Fri, 11 May 2012 13:56:12 -0700 Subject: [PATCH] Fix a few things in the ssl docs. Expanded the PyMongo examples and fixed the node-mongodb-native link. --- source/administration/ssl.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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