Skip to content

Commit 5e7ec53

Browse files
authored
DOCSP-31483: tls cert files read async v6 (#736)
* DOCSP-31483: tls cert files read async * CC PR suggestions
1 parent d84f4fb commit 5e7ec53

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

source/fundamentals/connection/connection-options.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,32 +226,40 @@ parameters of the connection URI to specify the behavior of the client.
226226
- ``false``
227227
- Specifies whether TLS is required for connections to the server.
228228
Using a ``srvServiceName`` of ``"mongodb+srv"``, or specifying other
229-
``tls`` prefixed options will default ``tls`` to ``true``.
229+
``tls``-prefixed options implicitly sets the value of ``tls`` to
230+
``true``.
230231

231232
* - **tlsAllowInvalidCertificates**
232233
- boolean
233234
- ``false``
234235
- Specifies whether the driver should error when the server’s
235-
TLS certificate is invalid.
236+
TLS certificate is invalid. You should only set this option to
237+
``true`` for testing purposes.
236238

237239
* - **tlsAllowInvalidHostnames**
238240
- boolean
239241
- ``false``
240242
- Specifies whether the driver should error when there is a mismatch
241243
between the server’s hostname and the hostname specified by the
242-
TLS certificate.
244+
TLS certificate. You should only set this option to
245+
``true`` for testing purposes.
243246

244247
* - **tlsCAFile**
245248
- string
246249
- ``null``
247250
- Specifies the path to a file with either a single or bundle of certificate
248-
authorities to trust when making a TLS connection.
251+
authorities to trust when making a TLS connection. To learn more
252+
about setting this connection option, see the :ref:`Provide
253+
Certificate Filepaths <node-tls-filepaths>` section of the TLS guide.
249254

250255
* - **tlsCertificateKeyFile**
251256
- string
252257
- ``null``
253258
- Specifies the path to the client certificate file or the client
254-
private key file. If you need both, you must concatenate the files.
259+
private key file. If you need both, you must concatenate the
260+
files. To learn more about setting this connection option, see
261+
the :ref:`Provide Certificate Filepaths <node-tls-filepaths>`
262+
section of the TLS guide.
255263

256264
* - **tlsCertificateKeyFilePassword**
257265
- string
@@ -263,7 +271,8 @@ parameters of the connection URI to specify the behavior of the client.
263271
- boolean
264272
- ``false``
265273
- Specifies to relax TLS constraints as much as possible, such as
266-
allowing invalid certificates or hostname mismatches.
274+
allowing invalid certificates or hostname mismatches. You should
275+
only set this option to ``true`` for testing purposes.
267276

268277
* - **w**
269278
- non-negative integer or string

source/fundamentals/connection/tls.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,15 @@ To learn more about the ``createSecureContext()`` method and the
182182
For a runnable example that uses a ``SecureContext`` object, see
183183
the :ref:`SecureContext Example <node-securecontext-full-example>`.
184184

185+
.. _node-tls-filepaths:
186+
185187
Provide Certificate Filepaths
186188
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187189

188190
You can include the filepaths for your certificates as client options to
189-
retrieve your certificates while connecting with TLS.
191+
retrieve your certificates while connecting with TLS. The driver reads
192+
these files when you call the ``connect()`` method on your
193+
``MongoClient`` instance.
190194

191195
The following code shows how to provide certificate filepaths as options
192196
in your ``MongoClient``:

source/upgrade.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ Version 6.x Breaking Changes
6666
``tlsCertificateFile`` option in the ``MongoClientOptions`` type.
6767
Create a ``SecureContext`` object or set the ``tls``-prefixed options
6868
in your ``MongoClientOptions`` instance instead.
69+
- The driver reads files set in the ``tlsCAFile`` and
70+
``tlsCertificateKeyFile`` connection options when you call the
71+
``MongoClient.connect()`` method, not when you create the
72+
``MongoClient`` instance.
6973

7074
.. _node-breaking-changes-v5.x:
7175

source/whats-new.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ The {+driver-short+} v6.0 release includes the following features:
7979
- ``maxIdleTimeMS``
8080
- ``waitQueueTimeoutMS``
8181

82+
- The driver asynchronously reads files set in the ``tlsCAFile`` and
83+
``tlsCertificateKeyFile`` connection options when you call
84+
the ``MongoClient.connect()`` method, not when you create a
85+
``MongoClient`` instance.
86+
8287
.. _version-5.7:
8388

8489
What's New in 5.7

0 commit comments

Comments
 (0)