Skip to content

Commit a6e909d

Browse files
(DOCSP-11336): Handle ca certificate for digest transport (#173)
* (DOCSP-11336): Handle ca certificate for digest transport * (DOCSP-11336): tech review feedback
1 parent 087b647 commit a6e909d

File tree

6 files changed

+100
-19
lines changed

6 files changed

+100
-19
lines changed

source/configure/configuration-file.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,17 @@ the following settings:
6060
- A project ID
6161

6262
The ``myOpsManager`` profile connects to an |onprem| deployment and
63-
contains contains the following settings:
64-
65-
- The |onprem| base |url|
66-
- An organization ID
67-
- |api| keys
68-
- A project ID
63+
contains the following settings:
64+
65+
- The |onprem| base |url|.
66+
- An organization ID.
67+
- |api| keys.
68+
- A project ID.
69+
- **Optional** The full path on your local system to the PEM-encoded
70+
Certificate Authority (CA) certificate used to sign the client and
71+
|onprem| TLS certificates
72+
- **Optional** Flag indicating whether the CA TLS certificate is
73+
verified.
6974

7075
.. code-block:: text
7176
:copyable: false
@@ -80,6 +85,8 @@ contains contains the following settings:
8085
service = "cloud"
8186

8287
[myOpsManager]
88+
ops_manager_ca_certificate = /etc/ssl/certs/ca.pem
89+
ops_manager_skip_verify = no
8390
ops_manager_url = "http://localhost:9080/"
8491
organization_id = "jklsa23123dsdf3jj456hs2"
8592
public_api_key = "HIJKLMN"

source/configure/environment-variables.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@ The {+mcli+} supports the following environment variables:
7777

7878
* - ``ops-manager``
7979
- |mms-full|
80+
81+
* - ``MCLI_OPS_MANAGER_CA_CERTIFICATE``
82+
- **|onprem| only** If applicable, the full path on your local
83+
system to the PEM-encoded Certificate Authority (CA) certificate
84+
used to sign the client and |onprem| TLS certificates.
85+
86+
* - ``MCLI_OPS_MANAGER_SKIP_VERIFY``
87+
- **|onprem| only** When set to ``yes``, the
88+
``MCLI_OPS_MANAGER_CA_CERTIFICATE`` TLS certificate is not
89+
verified. This prevents your connections from being rejected due
90+
to an invalid certificate.
91+
92+
.. important::
93+
94+
Setting ``MCLI_OPS_MANAGER_SKIP_VERIFY`` to ``yes`` is
95+
insecure and is not recommended in production environments.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. important::
2+
3+
Setting ``ops_manager_skip_verify`` to ``yes`` is insecure and is not
4+
recommended in production environments.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- ``org_id`` - Unique identifier of an organization.
2+
- ``project_id`` - Unique identifier of a project.
3+
- ``public_api_key`` - Public key for programmatic access.
4+
- ``private_api_key`` - Private key for programmatic access.
5+
- ``ops_manager_url`` - **|onprem| only** |mms| base URL.
6+
- ``ops_manager_ca_certificate`` - **|onprem| only**
7+
If applicable, the full path on your local system to the PEM-encoded
8+
Certificate Authority (CA) certificate used to sign the client and
9+
|onprem| TLS certificates.
10+
- ``ops_manager_skip_verify`` - **|onprem| only** When set to ``yes``,
11+
the ``ops_manager_ca_certificate`` TLS certificate is not verified.
12+
This prevents your connections from being rejected due to an invalid
13+
certificate.
14+
15+
.. include:: /includes/admonitions/skip-verify-insecure.rst

source/reference/config/config-describe.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ for recommended solutions.
6060

6161
public_api_key = redacted
6262
service = <service-name>
63+
ops_manager_ca_certificate = /etc/ssl/certs/ca.pem
64+
ops_manager_skip_verify = no
6365
ops_manager_url = <OM-URL>
6466
private_api_key = redacted
6567
project_id = <project-ID>
@@ -87,6 +89,8 @@ The preceding command prints the following output to the terminal:
8789

8890
public_api_key = redacted
8991
service = ops-manager
92+
ops_manager_ca_certificate = /etc/ssl/certs/ca.pem
93+
ops_manager_skip_verify = no
9094
ops_manager_url = http://localhost:30700
9195
private_api_key = redacted
9296
project_id = 5e84b2edf949e9007a7beac3

source/reference/mcli-config-set.txt

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ mongocli config set
1515
The ``config set`` command sets the following
1616
properties in the specified profile for {+mcli+}:
1717

18-
- ``org_id`` - Unique identifier of an organization
19-
- ``project_id`` - Unique identifier of a project
20-
- ``public_api_key`` - Public key for programmatic access
21-
- ``private_api_key`` - Private key for programmatic access
22-
- ``ops_manager_url`` - |mms| base URL for |onprem| only
18+
.. include:: /includes/config-set-properties.rst
2319

2420
You can set also set these properties by directly editing the
2521
:ref:`mcli-config-file` or by setting the :ref:`environment
@@ -62,13 +58,7 @@ Options
6258
- Property to set in the profile. Value
6359
can be one of the following:
6460

65-
- ``org_id`` - Unique identifier of the organization
66-
- ``project_id`` - Unique identifier of the project
67-
- ``public_api_key`` - Public key for programmatic
68-
access
69-
- ``private_api_key`` - Private key for programmatic
70-
access
71-
- ``ops_manager_url`` - |mms| base URL for |onprem| only
61+
.. include:: /includes/config-set-properties.rst
7262

7363
- yes
7464

@@ -81,6 +71,9 @@ Options
8171
- Public |api| key for ``public_api_key``
8272
- Private |api| key for ``private_api_key``
8373
- |mms| base URL for ``ops_manager_url``
74+
- Full path to the CA certificate for
75+
``ops_manager_ca_certificate``
76+
- ``yes`` or ``no`` for ``ops_manager_skip_verify``
8477

8578
- yes
8679

@@ -104,7 +97,9 @@ where ``<property-name>`` can be:
10497
- ``project_id``
10598
- ``public_api_key``
10699
- ``private_api_key``
107-
- ``ops_manager_url``
100+
- ``ops_manager_url``
101+
- ``ops_manager_ca_certificate``
102+
- ``ops_manager_skip_verify``
108103

109104
.. _config-set-examples:
110105

@@ -200,3 +195,43 @@ The previous command prints the following to the terminal:
200195
:copyable: false
201196

202197
Updated prop 'private_api_key'
198+
199+
Set Custom CA Certificate File
200+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201+
202+
The following example uses the ``mongocli config set`` command to
203+
set a custom CA certificate file for |onprem| in a profile named
204+
``egOMprofile``.
205+
206+
.. code-block:: sh
207+
:copyable: false
208+
209+
mongocli config set ops_manager_ca_certificate /etc/ssl/certs/ca.pem -p egOMprofile
210+
211+
The previous command prints the following to the terminal:
212+
213+
.. code-block:: sh
214+
:copyable: false
215+
216+
Updated property 'ops_manager_ca_certificate'
217+
218+
Set Certificate Verification
219+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
220+
221+
The following example uses the ``mongocli config set`` command to
222+
skip TLS certificate verification for |onprem| in a profile named
223+
``egOMprofile``.
224+
225+
.. include:: /includes/admonitions/skip-verify-insecure.rst
226+
227+
.. code-block:: sh
228+
:copyable: false
229+
230+
mongocli config set ops_manager_skip_verify yes -p egOMprofile
231+
232+
The previous command prints the following to the terminal:
233+
234+
.. code-block:: sh
235+
:copyable: false
236+
237+
Updated property 'ops_manager_skip_verify'

0 commit comments

Comments
 (0)