Skip to content

Commit b2aa065

Browse files
author
Divjot Arora
authored
Fix tests for tlsDisableOCSPEndpointCheck (#754)
1 parent d375b45 commit b2aa065

File tree

3 files changed

+69
-47
lines changed

3 files changed

+69
-47
lines changed

source/ocsp-support/ocsp-support.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ invalid, the driver SHOULD end the connection.
105105

106106
7. If the server’s certificate remains unvalidated, that certificate
107107
has a list of OCSP responder endpoints, and
108-
``tlsDisableOcspEndpointCheck`` is true (`if the driver supports
108+
``tlsDisableOCSPEndpointCheck`` is false (`if the driver supports
109109
this option <MongoClient Configuration>`_), the driver SHOULD send
110110
HTTP requests to the responders in parallel. The first valid
111111
response that concretely marks the certificate status as good or

source/uri-options/tests/tls-options.json

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -238,95 +238,107 @@
238238
"options": {}
239239
},
240240
{
241-
"description": "tlsDisableOcspEndpointCheck defaults to false",
241+
"description": "tlsDisableOCSPEndpointCheck defaults to false",
242242
"uri": "mongodb://example.com/?tls=true",
243-
"valid": false,
243+
"valid": true,
244244
"warning": false,
245245
"hosts": null,
246246
"auth": null,
247247
"options": {
248248
"tls": true,
249-
"tlsDisableOcspEndpointCheck": false
249+
"tlsDisableOCSPEndpointCheck": false
250250
}
251251
},
252252
{
253-
"description": "tlsDisableOcspEndpointCheck parses correctly",
254-
"uri": "mongodb://example.com/?tls=true&tlsDisableOcspEndpointCheck=true",
255-
"valid": false,
253+
"description": "tlsDisableOCSPEndpointCheck can be set to true",
254+
"uri": "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=true",
255+
"valid": true,
256+
"warning": false,
257+
"hosts": null,
258+
"auth": null,
259+
"options": {
260+
"tls": true,
261+
"tlsDisableOCSPEndpointCheck": true
262+
}
263+
},
264+
{
265+
"description": "tlsDisableOCSPEndpointCheck can be set to false",
266+
"uri": "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=false",
267+
"valid": true,
256268
"warning": false,
257269
"hosts": null,
258270
"auth": null,
259271
"options": {
260272
"tls": true,
261-
"tlsDisableOcspEndpointCheck": true
273+
"tlsDisableOCSPEndpointCheck": false
262274
}
263275
},
264276
{
265-
"description": "tlsInsecure and tlsDisableOcspEndpointCheck both present (and true) raises an error",
266-
"uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableOcspEndpointCheck=true",
277+
"description": "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and true) raises an error",
278+
"uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=true",
267279
"valid": false,
268280
"warning": false,
269281
"hosts": null,
270282
"auth": null,
271283
"options": {}
272284
},
273285
{
274-
"description": "tlsInsecure=true and tlsDisableOcspEndpointCheck=false raises an error",
275-
"uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableOcspEndpointCheck=false",
286+
"description": "tlsInsecure=true and tlsDisableOCSPEndpointCheck=false raises an error",
287+
"uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=false",
276288
"valid": false,
277289
"warning": false,
278290
"hosts": null,
279291
"auth": null,
280292
"options": {}
281293
},
282294
{
283-
"description": "tlsInsecure=false and tlsDisableOcspEndpointCheck=true raises an error",
284-
"uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableOcspEndpointCheck=true",
295+
"description": "tlsInsecure=false and tlsDisableOCSPEndpointCheck=true raises an error",
296+
"uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=true",
285297
"valid": false,
286298
"warning": false,
287299
"hosts": null,
288300
"auth": null,
289301
"options": {}
290302
},
291303
{
292-
"description": "tlsInsecure and tlsDisableOcspEndpointCheck both present (and false) raises an error",
293-
"uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableOcspEndpointCheck=false",
304+
"description": "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
305+
"uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=false",
294306
"valid": false,
295307
"warning": false,
296308
"hosts": null,
297309
"auth": null,
298310
"options": {}
299311
},
300312
{
301-
"description": "tlsDisableOcspEndpointCheck and tlsInsecure both present (and true) raises an error",
302-
"uri": "mongodb://example.com/?tlsDisableOcspEndpointCheck=true&tlsInsecure=true",
313+
"description": "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and true) raises an error",
314+
"uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=true",
303315
"valid": false,
304316
"warning": false,
305317
"hosts": null,
306318
"auth": null,
307319
"options": {}
308320
},
309321
{
310-
"description": "tlsDisableOcspEndpointCheck=true and tlsInsecure=false raises an error",
311-
"uri": "mongodb://example.com/?tlsDisableOcspEndpointCheck=true&tlsInsecure=false",
322+
"description": "tlsDisableOCSPEndpointCheck=true and tlsInsecure=false raises an error",
323+
"uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=false",
312324
"valid": false,
313325
"warning": false,
314326
"hosts": null,
315327
"auth": null,
316328
"options": {}
317329
},
318330
{
319-
"description": "tlsDisableOcspEndpointCheck=false and tlsInsecure=true raises an error",
320-
"uri": "mongodb://example.com/?tlsDisableOcspEndpointCheck=false&tlsInsecure=true",
331+
"description": "tlsDisableOCSPEndpointCheck=false and tlsInsecure=true raises an error",
332+
"uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=true",
321333
"valid": false,
322334
"warning": false,
323335
"hosts": null,
324336
"auth": null,
325337
"options": {}
326338
},
327339
{
328-
"description": "tlsDisableOcspEndpointCheck and tlsInsecure both present (and false) raises an error",
329-
"uri": "mongodb://example.com/?tlsDisableOcspEndpointCheck=false&tlsInsecure=false",
340+
"description": "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and false) raises an error",
341+
"uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=false",
330342
"valid": false,
331343
"warning": false,
332344
"hosts": null,

source/uri-options/tests/tls-options.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -207,84 +207,94 @@ tests:
207207
auth: ~
208208
options: {}
209209
-
210-
description: "tlsDisableOcspEndpointCheck defaults to false"
210+
description: "tlsDisableOCSPEndpointCheck defaults to false"
211211
uri: "mongodb://example.com/?tls=true"
212-
valid: false
212+
valid: true
213213
warning: false
214214
hosts: ~
215215
auth: ~
216216
options:
217217
tls: true
218-
tlsDisableOcspEndpointCheck: false
218+
tlsDisableOCSPEndpointCheck: false
219219
-
220-
description: "tlsDisableOcspEndpointCheck parses correctly"
221-
uri: "mongodb://example.com/?tls=true&tlsDisableOcspEndpointCheck=true"
222-
valid: false
220+
description: "tlsDisableOCSPEndpointCheck can be set to true"
221+
uri: "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=true"
222+
valid: true
223+
warning: false
224+
hosts: ~
225+
auth: ~
226+
options:
227+
tls: true
228+
tlsDisableOCSPEndpointCheck: true
229+
-
230+
description: "tlsDisableOCSPEndpointCheck can be set to false"
231+
uri: "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=false"
232+
valid: true
223233
warning: false
224234
hosts: ~
225235
auth: ~
226236
options:
227237
tls: true
228-
tlsDisableOcspEndpointCheck: true
238+
tlsDisableOCSPEndpointCheck: false
229239
-
230-
description: "tlsInsecure and tlsDisableOcspEndpointCheck both present (and true) raises an error"
231-
uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableOcspEndpointCheck=true"
240+
description: "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and true) raises an error"
241+
uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=true"
232242
valid: false
233243
warning: false
234244
hosts: ~
235245
auth: ~
236246
options: {}
237247
-
238-
description: "tlsInsecure=true and tlsDisableOcspEndpointCheck=false raises an error"
239-
uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableOcspEndpointCheck=false"
248+
description: "tlsInsecure=true and tlsDisableOCSPEndpointCheck=false raises an error"
249+
uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=false"
240250
valid: false
241251
warning: false
242252
hosts: ~
243253
auth: ~
244254
options: {}
245255
-
246-
description: "tlsInsecure=false and tlsDisableOcspEndpointCheck=true raises an error"
247-
uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableOcspEndpointCheck=true"
256+
description: "tlsInsecure=false and tlsDisableOCSPEndpointCheck=true raises an error"
257+
uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=true"
248258
valid: false
249259
warning: false
250260
hosts: ~
251261
auth: ~
252262
options: {}
253263
-
254-
description: "tlsInsecure and tlsDisableOcspEndpointCheck both present (and false) raises an error"
255-
uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableOcspEndpointCheck=false"
264+
description: "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and false) raises an error"
265+
uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=false"
256266
valid: false
257267
warning: false
258268
hosts: ~
259269
auth: ~
260270
options: {}
261271
-
262-
description: "tlsDisableOcspEndpointCheck and tlsInsecure both present (and true) raises an error"
263-
uri: "mongodb://example.com/?tlsDisableOcspEndpointCheck=true&tlsInsecure=true"
272+
description: "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and true) raises an error"
273+
uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=true"
264274
valid: false
265275
warning: false
266276
hosts: ~
267277
auth: ~
268278
options: {}
269279
-
270-
description: "tlsDisableOcspEndpointCheck=true and tlsInsecure=false raises an error"
271-
uri: "mongodb://example.com/?tlsDisableOcspEndpointCheck=true&tlsInsecure=false"
280+
description: "tlsDisableOCSPEndpointCheck=true and tlsInsecure=false raises an error"
281+
uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=false"
272282
valid: false
273283
warning: false
274284
hosts: ~
275285
auth: ~
276286
options: {}
277287
-
278-
description: "tlsDisableOcspEndpointCheck=false and tlsInsecure=true raises an error"
279-
uri: "mongodb://example.com/?tlsDisableOcspEndpointCheck=false&tlsInsecure=true"
288+
description: "tlsDisableOCSPEndpointCheck=false and tlsInsecure=true raises an error"
289+
uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=true"
280290
valid: false
281291
warning: false
282292
hosts: ~
283293
auth: ~
284294
options: {}
285295
-
286-
description: "tlsDisableOcspEndpointCheck and tlsInsecure both present (and false) raises an error"
287-
uri: "mongodb://example.com/?tlsDisableOcspEndpointCheck=false&tlsInsecure=false"
296+
description: "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and false) raises an error"
297+
uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=false"
288298
valid: false
289299
warning: false
290300
hosts: ~

0 commit comments

Comments
 (0)