File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -204,3 +204,23 @@ To connect to a replica set via SSL, use the following form:
204
204
);
205
205
206
206
.. _`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);
You can’t perform that action at this time.
0 commit comments