@@ -55,7 +55,7 @@ option to ``True``. You can do this in two ways: by passing an argument to the
55
55
56
56
.. code-block:: python
57
57
58
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>", tls=True)
58
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>", tls=True)
59
59
60
60
.. tab:: Connection String
61
61
:tabid: connectionstring
@@ -96,7 +96,7 @@ You can do this in two ways: by passing an argument to the
96
96
97
97
.. code-block:: python
98
98
99
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
99
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname> :<port>",
100
100
tls=True,
101
101
tlsCAFile="/path/to/ca.pem")
102
102
@@ -126,7 +126,7 @@ To use the Online Certificate Status Protocol (OCSP) to validate a server certif
126
126
you must install {+driver-short+} with the ``ocsp`` option, as shown in the following
127
127
example:
128
128
129
- .. code-block:: python
129
+ .. code-block:: sh
130
130
131
131
python -m pip install pymongo[ocsp]
132
132
@@ -154,7 +154,7 @@ You can do this in two ways: by passing an argument to the
154
154
155
155
.. code-block:: python
156
156
157
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
157
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname> :<port>",
158
158
tls=True,
159
159
tlsDisableOCSPEndpointCheck=True)
160
160
@@ -188,7 +188,7 @@ You can do this in two ways: by passing an argument to the
188
188
189
189
.. code-block:: python
190
190
191
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
191
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname> :<port>",
192
192
tls=True,
193
193
tlsCRLFile="/path/to/crl.pem")
194
194
@@ -221,7 +221,7 @@ You can do this in two ways: by passing an argument to the
221
221
222
222
.. code-block:: python
223
223
224
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
224
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname> :<port>",
225
225
tls=True,
226
226
tlsCertificateKeyFile='/path/to/client.pem')
227
227
@@ -230,7 +230,7 @@ You can do this in two ways: by passing an argument to the
230
230
231
231
.. code-block:: python
232
232
233
- uri = ("mongodb://<username>:<password>@<hostname@ :<port>/?"
233
+ uri = ("mongodb://<username>:<password>@<hostname:<port>/?"
234
234
"tls=true"
235
235
"&tlsCertificateKeyFile=path/to/client.pem")
236
236
client = pymongo.MongoClient(uri)
@@ -262,7 +262,7 @@ You can do this in two ways: by passing an argument to the
262
262
263
263
.. code-block:: python
264
264
265
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
265
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
266
266
tls=True,
267
267
tlsCertificateKeyFile='/path/to/client.pem',
268
268
tlsCertificateKeyFilePassword=<passphrase>)
@@ -272,7 +272,7 @@ You can do this in two ways: by passing an argument to the
272
272
273
273
.. code-block:: python
274
274
275
- uri = ("mongodb://<username>:<password>@<hostname@ :<port>/?"
275
+ uri = ("mongodb://<username>:<password>@<hostname:<port>/?"
276
276
"tls=true"
277
277
"&tlsCertificateKeyFile=path/to/client.pem"
278
278
"&tlsCertificateKeyFilePassword=<passphrase>")
@@ -311,7 +311,7 @@ option to ``True``. You can do this in two ways: by passing an argument to the
311
311
312
312
.. code-block:: python
313
313
314
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
314
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname:<port>",
315
315
tls=True,
316
316
tlsInsecure=True)
317
317
@@ -320,7 +320,7 @@ option to ``True``. You can do this in two ways: by passing an argument to the
320
320
321
321
.. code-block:: python
322
322
323
- uri = ("mongodb://<username>:<password>@<hostname@ :<port>/?"
323
+ uri = ("mongodb://<username>:<password>@<hostname> :<port>/?"
324
324
"tls=true"
325
325
"&tlsInsecure=true")
326
326
client = pymongo.MongoClient(uri)
@@ -335,7 +335,7 @@ To disable only certificate validation, set the ``tlsAllowInvalidCertificates``
335
335
336
336
.. code-block:: python
337
337
338
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
338
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname> :<port>",
339
339
tls=True,
340
340
tlsAllowInvalidCertificates=True)
341
341
@@ -344,7 +344,7 @@ To disable only certificate validation, set the ``tlsAllowInvalidCertificates``
344
344
345
345
.. code-block:: python
346
346
347
- uri = ("mongodb://<username>:<password>@<hostname@ :<port>/?"
347
+ uri = ("mongodb://<username>:<password>@<hostname> :<port>/?"
348
348
"tls=true"
349
349
"&tlsAllowInvalidCertificates=true")
350
350
client = pymongo.MongoClient(uri)
@@ -359,7 +359,7 @@ To disable only hostname verification, set the ``tlsAllowInvalidHostnames`` opti
359
359
360
360
.. code-block:: python
361
361
362
- client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname@ :<port>",
362
+ client = pymongo.MongoClient("mongodb://<username>:<password>@<hostname> :<port>",
363
363
tls=True,
364
364
tlsAllowInvalidHostnames=True)
365
365
@@ -368,7 +368,7 @@ To disable only hostname verification, set the ``tlsAllowInvalidHostnames`` opti
368
368
369
369
.. code-block:: python
370
370
371
- uri = ("mongodb://<username>:<password>@<hostname@ :<port>/?"
371
+ uri = ("mongodb://<username>:<password>@<hostname> :<port>/?"
372
372
"tls=true"
373
373
"&tlsAllowInvalidHostnames=true")
374
374
client = pymongo.MongoClient(uri)
0 commit comments