@@ -176,27 +176,34 @@ following options:
176
176
177
177
mongo --tls --host hostname.example.com --tlsCertificateKeyFile /etc/ssl/client.pem --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem
178
178
179
- On Windows and macOS,
180
- You can also use the :option:`--tlsCertificateSelector <mongo
181
- --tlsCertificateSelector>` option to specify the client certificate
182
- from the system certificate store instead of using
183
- :option:`--tlsCertificateKeyFile <mongo
184
- --tlsCertificateKeyFile>`. If the CA file is also in the system
185
- certificate store, you can omit the :option:`--tlsCAFile <mongo
186
- --tlsCAFile>` option as well. For example, to use a certificate
187
- with the ``CN`` (Common Name) of ``myclient.example.net`` and the CA
188
- file from the system certificate store on macOS, start a
189
- :binary:`~bin.mongo` shell with the following options:
190
-
191
- .. code-block:: sh
192
-
193
- mongo --tls --host hostname.example.com --tlsCertificateSelector subject="myclient.example.net"
194
-
195
- Although still available, the :binary:`~bin.mongo` shell
196
- :option:`--ssl <mongo --ssl>`, :option:`--sslCAFile <mongo
197
- --sslCAFile>`, :option:`--sslPEMKeyFile <mongo --sslPEMKeyFile>`,
198
- :option:`--sslCertificateSelector <mongo --sslCertificateSelector>`
199
- are :ref:`deprecated as of MongoDB 4.2 <4.2-tls>`.
179
+ Windows and macOS
180
+ `````````````````
181
+
182
+ To specify a client certificate from the system certificate store, use
183
+ the :option:`--tlsCertificateSelector <mongo
184
+ --tlsCertificateSelector>` option instead of
185
+ :option:`--tlsCertificateKeyFile <mongo
186
+ --tlsCertificateKeyFile>`.
187
+
188
+ If the CA file is also in the system certificate store, you can omit the
189
+ :option:`--tlsCAFile <mongo --tlsCAFile>` option.
190
+
191
+ For example, if a certificate with the ``CN`` (Common Name) of
192
+ ``myclient.example.net`` and the accompanying CA file are both in the
193
+ macOS system certificate store, you can connect like this:
194
+
195
+ .. code-block:: bash
196
+
197
+ mongo --tls --host hostname.example.com --tlsCertificateSelector subject="myclient.example.net"
198
+
199
+ These options are :ref:`deprecated starting in MongoDB 4.2 <4.2-tls>`:
200
+
201
+ - ``--ssl``
202
+ - ``--sslCAFile``
203
+ - ``--sslPEMKeyFile``
204
+ - ``--sslCertificateSelector``
205
+
206
+ If possible, you should use the ``tls`` alternatives instead.
200
207
201
208
Avoid Use of ``--tlsAllowInvalidCertificates`` Option
202
209
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -357,21 +364,22 @@ following options:
357
364
358
365
mongo --ssl --host hostname.example.com --sslPEMKeyFile /etc/ssl/client.pem --sslCAFile /etc/ssl/ca.pem
359
366
360
- On Windows and macOS,
361
- You can also use the :option:`--sslCertificateSelector <mongo
362
- --sslCertificateSelector>` option to specify the client certificate
363
- from the system certificate store instead of using
364
- :option:`--sslPEMKeyFile <mongo --sslPEMKeyFile>`. If the CA file
365
- is also in the system certificate store, you can omit the
366
- :option:`--sslCAFile <mongo --sslCAFile>` option as well. For
367
- example, to use a certificate with the ``CN`` (Common Name) of
368
- ``myclient.example.net`` and the CA file from the system certificate
369
- store on macOS, start a :binary:`~bin.mongo` shell with the
370
- following options:
371
-
372
- .. code-block:: sh
373
-
374
- mongo --ssl --host hostname.example.com --sslCertificateSelector subject=myclient.example.net
367
+ On Windows and macOS
368
+ ````````````````````
369
+
370
+ You can also use the ``--sslCertificateSelector`` option to specify the
371
+ client certificate from the system certificate store instead of using
372
+ ``--sslPEMKeyFile``. If the CA file is also in the system certificate
373
+ store, you can omit the ``--sslCAFile`` option.
374
+
375
+ For example, to use a certificate with the ``CN`` (Common Name) of
376
+ ``myclient.example.net`` and the CA file from the system certificate
377
+ store on macOS, start :binary:`~bin.mongosh` with the following
378
+ options:
379
+
380
+ .. code-block:: bash
381
+
382
+ mongosh --ssl --host hostname.example.com --sslCertificateSelector subject=myclient.example.net
375
383
376
384
Avoid Use of ``--sslAllowInvalidCertificates`` Option
377
385
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments