File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,34 @@ You can check if this is the issue by attempting to connect to a MongoDB
177
177
instance hosted on the local machine with the same code. A deployment on
178
178
the same machine doesn't require any authorization to connect.
179
179
180
+ .. _csharp-troubleshooting-connection-X509:
181
+
182
+ X.509 Credential Error
183
+ ~~~~~~~~~~~~~~~~~~~~~~
184
+
185
+ If you are using Windows as your operating system, you might encounter an issue in which the
186
+ {+driver-short+} is unable to locate an ``X.509`` authentication certificate in memory.
187
+ This error is raised with the following error message:
188
+
189
+ .. code-block:: none
190
+ :copyable: false
191
+
192
+ No credentials are available in the security package
193
+
194
+ The following section describes a method that may help resolve the issue.
195
+
196
+ Create and Store the Certificate On-Disk
197
+ ----------------------------------------
198
+
199
+ Use the following code to generate any ``X.509`` certificates required by your application:
200
+
201
+ .. code-block:: csharp
202
+
203
+ using (X509Certificate2 certWithKey = certOnly.CopyWithPrivateKey(key))
204
+ {
205
+ return new X509Certificate2(certWithKey.Export(X509ContentType.Pkcs12));
206
+ }
207
+
180
208
Error Sending Message
181
209
~~~~~~~~~~~~~~~~~~~~~
182
210
Original file line number Diff line number Diff line change @@ -388,6 +388,13 @@ see the corresponding syntax for specifying the ``X.509`` authentication mechani
388
388
You can alternatively pass ``null`` as the parameter to prompt the MongoDB
389
389
server to infer the username based on your ``X.509`` certificate.
390
390
391
+ .. note::
392
+
393
+ If you are using Windows, the driver might be unable to locate an ``X.509``
394
+ authentication certificate created in memory. To learn more about a potential solution to
395
+ this issue, see the :ref:`csharp-troubleshooting-connection-X509`
396
+ section of the Connection Troubleshooting guide.
397
+
391
398
API Documentation
392
399
-----------------
393
400
You can’t perform that action at this time.
0 commit comments