Skip to content

Commit a115940

Browse files
committed
DOCSP-44856: x509 authentication fixes
1 parent 56b07b0 commit a115940

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

source/fundamentals/authentication.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,18 @@ When you specify this authentication mechanism, the server authenticates
286286
the connection by reading the following files:
287287

288288
- A certificate authority (CA) file, which contains one or more
289-
certificate authorities to trust when making a TLS connection
290-
- A certificate key file, which references the client certificate private key
289+
certificate authorities to trust when making a TLS connection.
290+
Before connecting to the server, the driver uses this file to verify that the
291+
server's certificate is from the specified certificate authorities.
292+
293+
- A certificate key file, which contains the client certificate
294+
and private key. The driver presents this file to the server to
295+
verify the client.
296+
297+
.. tip::
298+
299+
To learn more about X.509 certificates, see
300+
:manual:`x.509 </core/security-x.509/>` in the {+server+} manual.
291301

292302
To specify the ``MONGODB-X509`` authentication mechanism, set the
293303
``mechanism`` field of your ``Credential`` struct to

source/includes/fundamentals/code-snippets/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async fn main() -> mongodb::error::Result<()> {
8080
tlsCertificateKeyFilePassword = "<password for client key>"
8181
);
8282
let mut client_options = ClientOptions::parse(uri).await?;
83-
let x509_cred = Credential::builder().mechanism(AuthMechanism::MongoDbAws).build();
83+
let x509_cred = Credential::builder().mechanism(AuthMechanism::MongoDbX509).build();
8484

8585
client_options.credential = Some(x509_cred);
8686
let client = Client::with_options(client_options)?;

0 commit comments

Comments
 (0)