Skip to content

Commit d6a3232

Browse files
authored
Merge pull request #99 from atsansone/DOCSP-15123
(DOCSP-15123) Add note to tlsCertificateSelector option
2 parents b5c82d9 + 47815a9 commit d6a3232

File tree

3 files changed

+68
-59
lines changed

3 files changed

+68
-59
lines changed
20.1 KB
Loading

source/includes/admonitions/fact-mdb-shell-beta.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.. admonition:: Beta
2-
:class: note
1+
.. note:: Beta Release
32

43
The |mdb-shell| (``mongosh``) is currently available as a **Beta**
54
release. The product, its features, and the corresponding

source/reference/options.txt

Lines changed: 67 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ General Options
2323
.. option:: --eval <javascript>
2424

2525
Evaluates a JavaScript expression that is specified as an argument.
26-
:program:`mongo` does not load its own environment when evaluating code.
27-
As a result many options of the shell environment are not available.
26+
:program:`mongo` does not load its own environment when evaluating
27+
code. As a result many options of the shell environment are not
28+
available.
2829

2930
.. option:: --help, -h
3031

@@ -38,7 +39,7 @@ General Options
3839

3940
Prevents the shell from sourcing and evaluating ``~/.mongorc.js`` on
4041
startup.
41-
42+
4243
.. option:: --version
4344

4445
Returns the |mdb-shell| release number.
@@ -52,15 +53,15 @@ Connection Options
5253
:binary:`~bin.mongod` or :binary:`~bin.mongos` is running. If this is
5354
not specified, the |mdb-shell| attempts to connect to a MongoDB
5455
process running on the localhost.
55-
56+
5657
To connect to a replica set,
5758
Specify the :setting:`replica set name <~replication.replSetName>`
5859
and a seed list of set members. Use the following form:
59-
60+
6061
.. code-block:: none
61-
62+
6263
<replSetName>/<hostname1><:port>,<hostname2><:port>,<...>
63-
64+
6465
For TLS/SSL connections (:option:`--tls <--tls>`),
6566
The |mdb-shell| shell verifies that the hostname
6667
(specified in the :option:`--host <--host>` option or the
@@ -70,7 +71,7 @@ Connection Options
7071
present, the |mdb-shell| does not match against the ``CN``. If
7172
the hostname does not match the ``SAN`` (or ``CN``), the
7273
|mdb-shell| shell fails to connect.
73-
74+
7475
For `DNS seedlist connections <https://docs.mongodb.com/manual/reference/connection-string/#dns-seedlist-connection-format/>`_,
7576
Specify the connection protocol as ``mongodb+srv``, followed by
7677
the DNS SRV hostname record and any options. The ``authSource``
@@ -82,9 +83,9 @@ Connection Options
8283
setting ``tls=false`` in the query string.
8384

8485
.. example::
85-
86+
8687
.. code-block:: none
87-
88+
8889
mongodb+srv://server.example.com/?connectionTimeout=3000ms
8990

9091
.. option:: --port <port>
@@ -98,18 +99,18 @@ TLS Options
9899
~~~~~~~~~~~
99100

100101
.. option:: --tls
101-
102+
102103
Enables connection to a :binary:`~bin.mongod` or
103104
:binary:`~bin.mongos` that has |tls-ssl| support enabled.
104-
105+
105106
.. include:: /includes/fact-ssl-see-more.rst
106107

107108
.. option:: --tlsCertificateKeyFile <filename>
108-
109+
109110
Specifies the :file:`.pem` file that contains both the |tls-ssl|
110111
certificate and key for the :binary:`~bin.mongo` shell. Specify the
111112
file name of the :file:`.pem` file using relative or absolute paths.
112-
113+
113114
This option is required when using the :option:`--tls <--tls>` option to connect to
114115
a :binary:`~bin.mongod` or :binary:`~bin.mongos` instance that
115116
requires :ref:`client certificates
@@ -119,76 +120,76 @@ TLS Options
119120
.. note::
120121

121122
.. include:: /includes/fact-certificate-expiry-warning.rst
122-
123+
123124
.. include:: /includes/fact-ssl-see-more.rst
124125

125126
.. option:: --tlsCertificateKeyFilePassword <value>
126-
127+
127128
Specifies the password to de-crypt the certificate-key file (i.e.
128129
:option:`--tlsCertificateKeyFile <--tlsCertificateKeyFile>`).
129-
130+
130131
Use the
131132
:option:`--tlsCertificateKeyFilePassword
132133
<--tlsCertificateKeyFilePassword>` option only if the
133134
certificate-key file is encrypted. In all cases, the |mdb-shell|
134135
redacts the password from all logging and reporting output.
135-
136+
136137
If the private key in the PEM file is encrypted and you do not
137138
specify the
138139
:option:`--tlsCertificateKeyFilePassword
139140
<--tlsCertificateKeyFilePassword>` option; the |mdb-shell| prompts
140141
for a passphrase.
141-
142+
142143
See :ref:`ssl-certificate-password`.
143-
144+
144145
.. include:: /includes/extracts/ssl-facts-see-more.rst
145146

146147
.. option:: --tlsCAFile <filename>
147-
148+
148149
Specifies the :file:`.pem` file that contains the root certificate
149150
chain from the Certificate Authority. This file is used to validate
150151
the certificate presented by the
151152
:binary:`~bin.mongod`/:binary:`~bin.mongos` instance.
152-
153+
153154
Specify the file name of the :file:`.pem` file using relative or
154155
absolute paths.
155-
156+
156157
.. include:: /includes/extracts/ssl-facts-see-more.rst
157158

158159
.. option:: --tlsCRLFile <filename>
159-
160+
160161
Specifies the :file:`.pem` file that contains the Certificate
161162
Revocation List. Specify the file name of the :file:`.pem` file
162163
using relative or absolute paths.
163-
164+
164165
.. include:: /includes/extracts/ssl-facts-see-more.rst
165166

166167
.. option:: --tlsAllowInvalidHostnames
167-
168+
168169
Disables the validation of the hostnames in the certificate presented
169170
by the :binary:`~bin.mongod`/:binary:`~bin.mongos` instance. Allows
170171
the |mdb-shell| to connect to MongoDB instances even if the hostname
171172
in the server certificates do not match the server's host.
172-
173+
173174
.. include:: /includes/extracts/ssl-facts-see-more.rst
174175

175176
.. option:: --tlsAllowInvalidCertificates
176177

177178
.. versionadded:: 4.2
178-
179+
179180
Bypasses the validation checks for the certificates presented by the
180181
:binary:`~bin.mongod`/:binary:`~bin.mongos` instance and allows
181182
connections to servers that present invalid certificates.
182-
183+
183184
.. note::
184-
185+
185186
Starting in MongoDB 4.0, if you specify
186187
:option:`--tlsAllowInvalidCertificates
187188
<--tlsAllowInvalidCertificates>` when using x.509
188189
authentication, an invalid certificate is only sufficient to
189190
establish a |tls-ssl| connection but is *insufficient* for
190191
authentication.
191-
192+
192193
.. warning::
193194

194195
Although available, avoid using the
@@ -209,32 +210,41 @@ TLS Options
209210
or :binary:`~bin.mongos` instances. If you only need to disable
210211
the validation of the hostname in the |tls-ssl| certificates, see
211212
:option:`--tlsAllowInvalidHostnames <--tlsAllowInvalidHostnames>`.
212-
213+
213214
.. include:: /includes/extracts/ssl-facts-see-more.rst
214215

215216
.. option:: --tlsCertificateSelector <parameter>=<value>
216-
217+
217218
Available on Windows and macOS as an alternative to
218219
:option:`--tlsCertificateKeyFile <--tlsCertificateKeyFile>`.
219-
220+
221+
.. important:: Windows and Importing Private Keys
222+
223+
When you import your private key, you must mark it as exportable.
224+
The Windows **Certificate Import Wizard** doesn't check this
225+
option by default.
226+
227+
.. figure:: /images/certificate-import-wizard.png
228+
:alt: Microsoft Certificate Import Wizard where the key marked as exportable
229+
220230
The :option:`--tlsCertificateKeyFile <--tlsCertificateKeyFile>` and
221-
:option:`--tlsCertificateSelector <--tlsCertificateSelector>` options
222-
are mutually exclusive. You can only specify one.
231+
:option:`--tlsCertificateSelector <--tlsCertificateSelector>`
232+
options are mutually exclusive. You can only specify one.
223233

224234
Specifies a certificate property in order to select a matching
225235
certificate from the operating system's certificate store.
226236

227-
:option:`--tlsCertificateSelector <--tlsCertificateSelector>` accepts
228-
an argument of the format ``<property>=<value>`` where the property
229-
can be one of the following:
237+
:option:`--tlsCertificateSelector <--tlsCertificateSelector>`
238+
accepts an argument of the format ``<property>=<value>`` where the
239+
property can be one of the following:
230240

231241
.. list-table::
232242
:header-rows: 1
233243

234244
* - Property
235245
- Value type
236246
- Description
237-
247+
238248
* - ``subject``
239249
- ASCII string
240250
- Subject name or common name on certificate
@@ -257,25 +267,25 @@ TLS Options
257267
.. include:: /includes/fact-certificate-expiry-warning.rst
258268

259269
.. option:: --tlsDisabledProtocols <string>
260-
270+
261271
Disables the specified TLS protocols. The option recognizes the
262272
following protocols:
263-
273+
264274
- ``TLS1_0``
265275
- ``TLS1_1``
266276
- ``TLS1_2``
267277
- *(Starting in version 4.0.4, 3.6.9, 3.4.24)* ``TLS1_3``
268-
278+
269279
- On macOS, you cannot disable ``TLS1_1`` and leave both ``TLS1_0``
270280
and ``TLS1_2`` enabled. You must also disable at least one of the
271281
other two; for example, ``TLS1_0,TLS1_1``.
272-
282+
273283
- To list multiple protocols, specify as a comma separated list of
274284
protocols. For example ``TLS1_0,TLS1_1``.
275-
285+
276286
- The specified disabled protocols overrides any default disabled
277287
protocols.
278-
288+
279289
Starting in version 4.0, MongoDB disables the use of TLS 1.0 if TLS
280290
1.1+ is available on the system. To enable the
281291
disabled TLS 1.0, specify ``none`` to
@@ -285,11 +295,11 @@ Authentication Options
285295
----------------------
286296

287297
.. option:: --authenticationDatabase <dbname>
288-
298+
289299
Specifies the authentication database where the specified
290300
:option:`--username <--username>` has been created. See
291301
:ref:`user-authentication-database`.
292-
302+
293303

294304
If you do not specify a value for
295305
:option:`--authenticationDatabase <--authenticationDatabase>`,
@@ -302,17 +312,17 @@ Authentication Options
302312

303313
Specifies the authentication mechanism the |mdb-shell| uses to
304314
authenticate to the :binary:`~bin.mongod` or :binary:`~bin.mongos`.
305-
315+
306316
.. note::
307-
317+
308318
Starting in version 4.0:
309-
319+
310320
- MongoDB removes support for the deprecated MongoDB
311321
Challenge-Response (``MONGODB-CR``) authentication mechanism.
312-
322+
313323
- MongoDB adds support for SCRAM mechanism using the SHA-256 hash
314324
function (``SCRAM-SHA-256``).
315-
325+
316326
.. list-table::
317327
:header-rows: 1
318328
:widths: 20 40
@@ -358,14 +368,14 @@ Authentication Options
358368
Specify the hostname of a service using
359369
:manual:`GSSAPI/Kerberos </core/kerberos>`. Only required if the
360370
hostname of a machine does not match the hostname resolved by DNS.
361-
371+
362372
This option is available only in MongoDB Enterprise.
363373

364374
.. option:: --gssapiServiceName
365375

366376
Specify the name of the service using
367377
:manual:`GSSAPI/Kerberos </core/kerberos>`. Only required if the service does not use the default name of ``mongodb``.
368-
378+
369379
This option is available only in MongoDB Enterprise.
370380

371381
.. option:: --password <password>, -p <password>
@@ -391,10 +401,10 @@ Session Options
391401
---------------
392402

393403
.. option:: --retryWrites
394-
404+
395405
Enables :manual:`retryable writes </core/retryable-writes/>` as the
396406
default for sessions in the |mdb-shell|.
397-
407+
398408
For more information on sessions, see :ref:`sessions`.
399409

400410
.. disableImplicitSessions

0 commit comments

Comments
 (0)