Skip to content

Commit 2a49924

Browse files
committed
DOCSP-40417: Add X509 troubleshooting steps (#213)
(cherry picked from commit 3a03130)
1 parent 945ef94 commit 2a49924

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

source/connection-troubleshooting.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,34 @@ You can check if this is the issue by attempting to connect to a MongoDB
177177
instance hosted on the local machine with the same code. A deployment on
178178
the 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+
180208
Error Sending Message
181209
~~~~~~~~~~~~~~~~~~~~~
182210

source/fundamentals/authentication.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
391398
API Documentation
392399
-----------------
393400

0 commit comments

Comments
 (0)