Skip to content

Commit d2511a8

Browse files
committed
added documentation for using SSL support in the .NET driver.
1 parent d2e99a9 commit d2511a8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

source/administration/ssl.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,23 @@ To connect to a replica set via SSL, use the following form:
204204
);
205205

206206
.. _`node-mongodb-native`: https://github.com/mongodb/node-mongodb-native
207+
208+
.NET
209+
~~~~
210+
As of release 1.6 of the .NET driver, to use SSL with a server, all that is needed
211+
is to add an option to the connection string, "ssl=true".
212+
213+
.. code-block:: csharp
214+
215+
var connectionString = "mongodb://localhost/?ssl=true";
216+
var server = MongoServer.Create(connectionString);
217+
218+
Using SSL in the .NET driver will cause the server certificates to get validated
219+
against the local trusted certificate store. This can cause issues in testing due
220+
to test machines not having trusted certificates. If this is the case, you can
221+
add another option to prevent validating the certificates, "sslverifycertificate=false".
222+
223+
.. code-block:: csharp
224+
225+
var connectionString = "mongodb://localhost/?ssl=true&sslverifycertificate=false";
226+
var server = MongoServer.Create(connectionString);

0 commit comments

Comments
 (0)