Skip to content

[Backport v2.25] DOCSP-49301 Fix X.509 MongoCredential code example #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions source/fundamentals/authentication/x509.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ Code Placeholders

The code examples on this page use the following placeholders:

- ``+srv``: Include this option in your connection string prefix only if you are connecting
to a MongoDB Atlas cluster. To learn more about the ``+srv`` option, see
:manual:`Connection String Formats </reference/connection-string/#connection-string-formats>`
in the {+mdb-server+} manual.
- ``+srv``: Include this option in your connection string prefix only if you are
connecting to a MongoDB Atlas cluster. If you're using a
``MongoClientSettings`` object, you can specify the ``srv`` format by setting
the ``Scheme`` property to ``ConnectionStringScheme.MongoDBPlusSrv``. To learn
more about the ``+srv`` option, see :manual:`Connection String Formats </reference/connection-string/#connection-string-formats>` in the
{+mdb-server+} manual.
- ``<hostname>``: The network address of your MongoDB deployment.
- ``<port>``: The port number of the MongoDB deployment. If you omit this parameter,
the driver uses the default port number (``27017``). You don't need a port number
Expand Down Expand Up @@ -119,6 +121,7 @@ see the corresponding syntax:
},
UseTls = true,
Server = new MongoServerAddress("<hostname>"[, "<port>"]),
Scheme = ConnectionStringScheme.MongoDBPlusSrv, // Needed when connecting to MongoDB Atlas
};

Troubleshooting
Expand Down