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
177177instance hosted on the local machine with the same code. A deployment on
178178the same machine doesn't require any authorization to connect.
179179
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+
180208Error Sending Message
181209~~~~~~~~~~~~~~~~~~~~~
182210
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
388388 You can alternatively pass ``null`` as the parameter to prompt the MongoDB
389389 server to infer the username based on your ``X.509`` certificate.
390390
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+
391398API Documentation
392399-----------------
393400
You can’t perform that action at this time.
0 commit comments