@@ -184,26 +184,35 @@ following options:
184
184
185
185
mongosh --tls --host hostname.example.com --tlsCertificateKeyFile /etc/ssl/client.pem --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem
186
186
187
- On Windows and macOS,
188
- You can also use the :option:`--tlsCertificateSelector <mongosh
189
- --tlsCertificateSelector>` option to specify the client certificate
190
- from the system certificate store instead of using
191
- :option:`--tlsCertificateKeyFile <mongosh
192
- --tlsCertificateKeyFile>`. If the CA file is also in the system
193
- certificate store, you can omit the :option:`--tlsCAFile <mongosh
194
- --tlsCAFile>` option as well. For example, to use a certificate
195
- with the ``CN`` (Common Name) of ``myclient.example.net`` and the CA
196
- file from the system certificate store on macOS, start
197
- :binary:`~bin.mongosh` with the following options:
198
-
199
- .. code-block:: bash
200
-
201
- mongosh --tls --host hostname.example.com --tlsCertificateSelector subject="myclient.example.net"
202
-
203
- Although still available, :binary:`~bin.mongosh`
204
- ``--ssl``, ``--sslCAFile``, ``--sslPEMKeyFile``, and
205
- ``--sslCertificateSelector`` options
206
- are :ref:`deprecated as of MongoDB 4.2 <4.2-tls>`.
187
+ Windows and macOS
188
+ `````````````````
189
+
190
+ To specify a client certificate from the system certificate store, use
191
+ the :option:`--tlsCertificateSelector <mongosh
192
+ --tlsCertificateSelector>` option instead of
193
+ :option:`--tlsCertificateKeyFile <mongosh
194
+ --tlsCertificateKeyFile>`.
195
+
196
+ If the CA file is also in the system certificate store, you can omit the
197
+ :option:`--tlsCAFile <mongosh --tlsCAFile>` option.
198
+
199
+ For example, if a certificate with the ``CN`` (Common Name) of
200
+ ``myclient.example.net`` and the accompanying CA file are both in the
201
+ macOS system certificate store, you can connect like this:
202
+
203
+ .. code-block:: bash
204
+
205
+ mongosh --tls --host hostname.example.com --tlsCertificateSelector subject="myclient.example.net"
206
+
207
+ These options are :ref:`deprecated starting in MongoDB 4.2 <4.2-tls>`:
208
+
209
+ - ``--ssl``
210
+ - ``--sslCAFile``
211
+ - ``--sslPEMKeyFile``
212
+ - ``--sslCertificateSelector``
213
+
214
+ There are available in ``mongosh``, but you should use the ``tls``
215
+ alternatives instead.
207
216
208
217
Avoid Use of ``--tlsAllowInvalidCertificates`` Option
209
218
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -362,19 +371,22 @@ following options:
362
371
363
372
mongosh --ssl --host hostname.example.com --sslPEMKeyFile /etc/ssl/client.pem --sslCAFile /etc/ssl/ca.pem
364
373
365
- On Windows and macOS,
366
- You can also use the ``--sslCertificateSelector`` option to specify
367
- the client certificate from the system certificate store instead of
368
- using ``--sslPEMKeyFile``. If the CA file is also in the system
369
- certificate store, you can omit the ``--sslCAFile`` option as well.
370
- For example, to use a certificate with the ``CN`` (Common Name) of
371
- ``myclient.example.net`` and the CA file from the system certificate
372
- store on macOS, start :binary:`~bin.mongosh` with the following
373
- options:
374
+ On Windows and macOS
375
+ ````````````````````
374
376
375
- .. code-block:: bash
377
+ You can also use the ``--sslCertificateSelector`` option to specify the
378
+ client certificate from the system certificate store instead of using
379
+ ``--sslPEMKeyFile``. If the CA file is also in the system certificate
380
+ store, you can omit the ``--sslCAFile`` option.
381
+
382
+ For example, to use a certificate with the ``CN`` (Common Name) of
383
+ ``myclient.example.net`` and the CA file from the system certificate
384
+ store on macOS, start :binary:`~bin.mongosh` with the following
385
+ options:
386
+
387
+ .. code-block:: bash
376
388
377
- mongosh --ssl --host hostname.example.com --sslCertificateSelector subject=myclient.example.net
389
+ mongosh --ssl --host hostname.example.com --sslCertificateSelector subject=myclient.example.net
378
390
379
391
Avoid Use of ``--sslAllowInvalidCertificates`` Option
380
392
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments