1{
2 "tests": [
3 {
4 "description": "Valid required tls options are parsed correctly",
5 "uri": "mongodb://example.com/?tls=true&tlsCAFile=ca.pem&tlsCertificateKeyFile=cert.pem",
6 "valid": true,
7 "warning": false,
8 "hosts": null,
9 "auth": null,
10 "options": {
11 "tls": true,
12 "tlsCAFile": "ca.pem",
13 "tlsCertificateKeyFile": "cert.pem"
14 }
15 },
16 {
17 "description": "Valid tlsCertificateKeyFilePassword is parsed correctly",
18 "uri": "mongodb://example.com/?tlsCertificateKeyFilePassword=hunter2",
19 "valid": true,
20 "warning": false,
21 "hosts": null,
22 "auth": null,
23 "options": {
24 "tlsCertificateKeyFilePassword": "hunter2"
25 }
26 },
27 {
28 "description": "Invalid tlsAllowInvalidCertificates causes a warning",
29 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=invalid",
30 "valid": true,
31 "warning": true,
32 "hosts": null,
33 "auth": null,
34 "options": {}
35 },
36 {
37 "description": "tlsAllowInvalidCertificates is parsed correctly",
38 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true",
39 "valid": true,
40 "warning": false,
41 "hosts": null,
42 "auth": null,
43 "options": {
44 "tlsAllowInvalidCertificates": true
45 }
46 },
47 {
48 "description": "Invalid tlsAllowInvalidCertificates causes a warning",
49 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=invalid",
50 "valid": true,
51 "warning": true,
52 "hosts": null,
53 "auth": null,
54 "options": {}
55 },
56 {
57 "description": "tlsAllowInvalidHostnames is parsed correctly",
58 "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=true",
59 "valid": true,
60 "warning": false,
61 "hosts": null,
62 "auth": null,
63 "options": {
64 "tlsAllowInvalidHostnames": true
65 }
66 },
67 {
68 "description": "Invalid tlsAllowInvalidHostnames causes a warning",
69 "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=invalid",
70 "valid": true,
71 "warning": true,
72 "hosts": null,
73 "auth": null,
74 "options": {}
75 },
76 {
77 "description": "tlsInsecure is parsed correctly",
78 "uri": "mongodb://example.com/?tlsInsecure=true",
79 "valid": true,
80 "warning": false,
81 "hosts": null,
82 "auth": null,
83 "options": {
84 "tlsInsecure": true
85 }
86 },
87 {
88 "description": "Invalid tlsInsecure causes a warning",
89 "uri": "mongodb://example.com/?tlsInsecure=invalid",
90 "valid": true,
91 "warning": true,
92 "hosts": null,
93 "auth": null,
94 "options": {}
95 },
96 {
97 "description": "tlsInsecure and tlsAllowInvalidCertificates both present (and true) raises an error",
98 "uri": "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidCertificates=true",
99 "valid": false,
100 "warning": false,
101 "hosts": null,
102 "auth": null,
103 "options": {}
104 },
105 {
106 "description": "tlsInsecure and tlsAllowInvalidCertificates both present (and false) raises an error",
107 "uri": "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidCertificates=false",
108 "valid": false,
109 "warning": false,
110 "hosts": null,
111 "auth": null,
112 "options": {}
113 },
114 {
115 "description": "tlsAllowInvalidCertificates and tlsInsecure both present (and true) raises an error",
116 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsInsecure=true",
117 "valid": false,
118 "warning": false,
119 "hosts": null,
120 "auth": null,
121 "options": {}
122 },
123 {
124 "description": "tlsAllowInvalidCertificates and tlsInsecure both present (and false) raises an error",
125 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsInsecure=false",
126 "valid": false,
127 "warning": false,
128 "hosts": null,
129 "auth": null,
130 "options": {}
131 },
132 {
133 "description": "tlsInsecure and tlsAllowInvalidHostnames both present (and true) raises an error",
134 "uri": "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidHostnames=true",
135 "valid": false,
136 "warning": false,
137 "hosts": null,
138 "auth": null,
139 "options": {}
140 },
141 {
142 "description": "tlsInsecure and tlsAllowInvalidHostnames both present (and false) raises an error",
143 "uri": "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidHostnames=false",
144 "valid": false,
145 "warning": false,
146 "hosts": null,
147 "auth": null,
148 "options": {}
149 },
150 {
151 "description": "tlsAllowInvalidHostnames and tlsInsecure both present (and true) raises an error",
152 "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=true&tlsInsecure=true",
153 "valid": false,
154 "warning": false,
155 "hosts": null,
156 "auth": null,
157 "options": {}
158 },
159 {
160 "description": "tlsAllowInvalidHostnames and tlsInsecure both present (and false) raises an error",
161 "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=false&tlsInsecure=false",
162 "valid": false,
163 "warning": false,
164 "hosts": null,
165 "auth": null,
166 "options": {}
167 },
168 {
169 "description": "tls=true and ssl=true doesn't warn",
170 "uri": "mongodb://example.com/?tls=true&ssl=true",
171 "valid": true,
172 "warning": false,
173 "hosts": null,
174 "auth": null,
175 "options": {}
176 },
177 {
178 "description": "tls=false and ssl=false doesn't warn",
179 "uri": "mongodb://example.com/?tls=false&ssl=false",
180 "valid": true,
181 "warning": false,
182 "hosts": null,
183 "auth": null,
184 "options": {}
185 },
186 {
187 "description": "ssl=true and tls=true doesn't warn",
188 "uri": "mongodb://example.com/?ssl=true&tls=true",
189 "valid": true,
190 "warning": false,
191 "hosts": null,
192 "auth": null,
193 "options": {}
194 },
195 {
196 "description": "ssl=false and tls=false doesn't warn",
197 "uri": "mongodb://example.com/?ssl=false&tls=false",
198 "valid": true,
199 "warning": false,
200 "hosts": null,
201 "auth": null,
202 "options": {}
203 },
204 {
205 "description": "tls=false and ssl=true raises error",
206 "uri": "mongodb://example.com/?tls=false&ssl=true",
207 "valid": false,
208 "warning": false,
209 "hosts": null,
210 "auth": null,
211 "options": {}
212 },
213 {
214 "description": "tls=true and ssl=false raises error",
215 "uri": "mongodb://example.com/?tls=true&ssl=false",
216 "valid": false,
217 "warning": false,
218 "hosts": null,
219 "auth": null,
220 "options": {}
221 },
222 {
223 "description": "ssl=false and tls=true raises error",
224 "uri": "mongodb://example.com/?ssl=false&tls=true",
225 "valid": false,
226 "warning": false,
227 "hosts": null,
228 "auth": null,
229 "options": {}
230 },
231 {
232 "description": "ssl=true and tls=false raises error",
233 "uri": "mongodb://example.com/?ssl=true&tls=false",
234 "valid": false,
235 "warning": false,
236 "hosts": null,
237 "auth": null,
238 "options": {}
239 },
240 {
241 "description": "tlsDisableCertificateRevocationCheck can be set to true",
242 "uri": "mongodb://example.com/?tls=true&tlsDisableCertificateRevocationCheck=true",
243 "valid": true,
244 "warning": false,
245 "hosts": null,
246 "auth": null,
247 "options": {
248 "tls": true,
249 "tlsDisableCertificateRevocationCheck": true
250 }
251 },
252 {
253 "description": "tlsDisableCertificateRevocationCheck can be set to false",
254 "uri": "mongodb://example.com/?tls=true&tlsDisableCertificateRevocationCheck=false",
255 "valid": true,
256 "warning": false,
257 "hosts": null,
258 "auth": null,
259 "options": {
260 "tls": true,
261 "tlsDisableCertificateRevocationCheck": false
262 }
263 },
264 {
265 "description": "tlsAllowInvalidCertificates and tlsDisableCertificateRevocationCheck both present (and true) raises an error",
266 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableCertificateRevocationCheck=true",
267 "valid": false,
268 "warning": false,
269 "hosts": null,
270 "auth": null,
271 "options": {}
272 },
273 {
274 "description": "tlsAllowInvalidCertificates=true and tlsDisableCertificateRevocationCheck=false raises an error",
275 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableCertificateRevocationCheck=false",
276 "valid": false,
277 "warning": false,
278 "hosts": null,
279 "auth": null,
280 "options": {}
281 },
282 {
283 "description": "tlsAllowInvalidCertificates=false and tlsDisableCertificateRevocationCheck=true raises an error",
284 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableCertificateRevocationCheck=true",
285 "valid": false,
286 "warning": false,
287 "hosts": null,
288 "auth": null,
289 "options": {}
290 },
291 {
292 "description": "tlsAllowInvalidCertificates and tlsDisableCertificateRevocationCheck both present (and false) raises an error",
293 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableCertificateRevocationCheck=false",
294 "valid": false,
295 "warning": false,
296 "hosts": null,
297 "auth": null,
298 "options": {}
299 },
300 {
301 "description": "tlsDisableCertificateRevocationCheck and tlsAllowInvalidCertificates both present (and true) raises an error",
302 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsAllowInvalidCertificates=true",
303 "valid": false,
304 "warning": false,
305 "hosts": null,
306 "auth": null,
307 "options": {}
308 },
309 {
310 "description": "tlsDisableCertificateRevocationCheck=true and tlsAllowInvalidCertificates=false raises an error",
311 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsAllowInvalidCertificates=false",
312 "valid": false,
313 "warning": false,
314 "hosts": null,
315 "auth": null,
316 "options": {}
317 },
318 {
319 "description": "tlsDisableCertificateRevocationCheck=false and tlsAllowInvalidCertificates=true raises an error",
320 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsAllowInvalidCertificates=true",
321 "valid": false,
322 "warning": false,
323 "hosts": null,
324 "auth": null,
325 "options": {}
326 },
327 {
328 "description": "tlsDisableCertificateRevocationCheck and tlsAllowInvalidCertificates both present (and false) raises an error",
329 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsAllowInvalidCertificates=false",
330 "valid": false,
331 "warning": false,
332 "hosts": null,
333 "auth": null,
334 "options": {}
335 },
336 {
337 "description": "tlsInsecure and tlsDisableCertificateRevocationCheck both present (and true) raises an error",
338 "uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableCertificateRevocationCheck=true",
339 "valid": false,
340 "warning": false,
341 "hosts": null,
342 "auth": null,
343 "options": {}
344 },
345 {
346 "description": "tlsInsecure=true and tlsDisableCertificateRevocationCheck=false raises an error",
347 "uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableCertificateRevocationCheck=false",
348 "valid": false,
349 "warning": false,
350 "hosts": null,
351 "auth": null,
352 "options": {}
353 },
354 {
355 "description": "tlsInsecure=false and tlsDisableCertificateRevocationCheck=true raises an error",
356 "uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableCertificateRevocationCheck=true",
357 "valid": false,
358 "warning": false,
359 "hosts": null,
360 "auth": null,
361 "options": {}
362 },
363 {
364 "description": "tlsInsecure and tlsDisableCertificateRevocationCheck both present (and false) raises an error",
365 "uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableCertificateRevocationCheck=false",
366 "valid": false,
367 "warning": false,
368 "hosts": null,
369 "auth": null,
370 "options": {}
371 },
372 {
373 "description": "tlsDisableCertificateRevocationCheck and tlsInsecure both present (and true) raises an error",
374 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsInsecure=true",
375 "valid": false,
376 "warning": false,
377 "hosts": null,
378 "auth": null,
379 "options": {}
380 },
381 {
382 "description": "tlsDisableCertificateRevocationCheck=true and tlsInsecure=false raises an error",
383 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsInsecure=false",
384 "valid": false,
385 "warning": false,
386 "hosts": null,
387 "auth": null,
388 "options": {}
389 },
390 {
391 "description": "tlsDisableCertificateRevocationCheck=false and tlsInsecure=true raises an error",
392 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsInsecure=true",
393 "valid": false,
394 "warning": false,
395 "hosts": null,
396 "auth": null,
397 "options": {}
398 },
399 {
400 "description": "tlsDisableCertificateRevocationCheck and tlsInsecure both present (and false) raises an error",
401 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsInsecure=false",
402 "valid": false,
403 "warning": false,
404 "hosts": null,
405 "auth": null,
406 "options": {}
407 },
408 {
409 "description": "tlsDisableCertificateRevocationCheck and tlsDisableOCSPEndpointCheck both present (and true) raises an error",
410 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsDisableOCSPEndpointCheck=true",
411 "valid": false,
412 "warning": false,
413 "hosts": null,
414 "auth": null,
415 "options": {}
416 },
417 {
418 "description": "tlsDisableCertificateRevocationCheck=true and tlsDisableOCSPEndpointCheck=false raises an error",
419 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsDisableOCSPEndpointCheck=false",
420 "valid": false,
421 "warning": false,
422 "hosts": null,
423 "auth": null,
424 "options": {}
425 },
426 {
427 "description": "tlsDisableCertificateRevocationCheck=false and tlsDisableOCSPEndpointCheck=true raises an error",
428 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsDisableOCSPEndpointCheck=true",
429 "valid": false,
430 "warning": false,
431 "hosts": null,
432 "auth": null,
433 "options": {}
434 },
435 {
436 "description": "tlsDisableCertificateRevocationCheck and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
437 "uri": "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsDisableOCSPEndpointCheck=false",
438 "valid": false,
439 "warning": false,
440 "hosts": null,
441 "auth": null,
442 "options": {}
443 },
444 {
445 "description": "tlsDisableOCSPEndpointCheck and tlsDisableCertificateRevocationCheck both present (and true) raises an error",
446 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsDisableCertificateRevocationCheck=true",
447 "valid": false,
448 "warning": false,
449 "hosts": null,
450 "auth": null,
451 "options": {}
452 },
453 {
454 "description": "tlsDisableOCSPEndpointCheck=true and tlsDisableCertificateRevocationCheck=false raises an error",
455 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsDisableCertificateRevocationCheck=false",
456 "valid": false,
457 "warning": false,
458 "hosts": null,
459 "auth": null,
460 "options": {}
461 },
462 {
463 "description": "tlsDisableOCSPEndpointCheck=false and tlsDisableCertificateRevocationCheck=true raises an error",
464 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsDisableCertificateRevocationCheck=true",
465 "valid": false,
466 "warning": false,
467 "hosts": null,
468 "auth": null,
469 "options": {}
470 },
471 {
472 "description": "tlsDisableOCSPEndpointCheck and tlsDisableCertificateRevocationCheck both present (and false) raises an error",
473 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsDisableCertificateRevocationCheck=false",
474 "valid": false,
475 "warning": false,
476 "hosts": null,
477 "auth": null,
478 "options": {}
479 },
480 {
481 "description": "tlsDisableOCSPEndpointCheck can be set to true",
482 "uri": "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=true",
483 "valid": true,
484 "warning": false,
485 "hosts": null,
486 "auth": null,
487 "options": {
488 "tls": true,
489 "tlsDisableOCSPEndpointCheck": true
490 }
491 },
492 {
493 "description": "tlsDisableOCSPEndpointCheck can be set to false",
494 "uri": "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=false",
495 "valid": true,
496 "warning": false,
497 "hosts": null,
498 "auth": null,
499 "options": {
500 "tls": true,
501 "tlsDisableOCSPEndpointCheck": false
502 }
503 },
504 {
505 "description": "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and true) raises an error",
506 "uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=true",
507 "valid": false,
508 "warning": false,
509 "hosts": null,
510 "auth": null,
511 "options": {}
512 },
513 {
514 "description": "tlsInsecure=true and tlsDisableOCSPEndpointCheck=false raises an error",
515 "uri": "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=false",
516 "valid": false,
517 "warning": false,
518 "hosts": null,
519 "auth": null,
520 "options": {}
521 },
522 {
523 "description": "tlsInsecure=false and tlsDisableOCSPEndpointCheck=true raises an error",
524 "uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=true",
525 "valid": false,
526 "warning": false,
527 "hosts": null,
528 "auth": null,
529 "options": {}
530 },
531 {
532 "description": "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
533 "uri": "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=false",
534 "valid": false,
535 "warning": false,
536 "hosts": null,
537 "auth": null,
538 "options": {}
539 },
540 {
541 "description": "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and true) raises an error",
542 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=true",
543 "valid": false,
544 "warning": false,
545 "hosts": null,
546 "auth": null,
547 "options": {}
548 },
549 {
550 "description": "tlsDisableOCSPEndpointCheck=true and tlsInsecure=false raises an error",
551 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=false",
552 "valid": false,
553 "warning": false,
554 "hosts": null,
555 "auth": null,
556 "options": {}
557 },
558 {
559 "description": "tlsDisableOCSPEndpointCheck=false and tlsInsecure=true raises an error",
560 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=true",
561 "valid": false,
562 "warning": false,
563 "hosts": null,
564 "auth": null,
565 "options": {}
566 },
567 {
568 "description": "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and false) raises an error",
569 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=false",
570 "valid": false,
571 "warning": false,
572 "hosts": null,
573 "auth": null,
574 "options": {}
575 },
576 {
577 "description": "tlsAllowInvalidCertificates and tlsDisableOCSPEndpointCheck both present (and true) raises an error",
578 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableOCSPEndpointCheck=true",
579 "valid": false,
580 "warning": false,
581 "hosts": null,
582 "auth": null,
583 "options": {}
584 },
585 {
586 "description": "tlsAllowInvalidCertificates=true and tlsDisableOCSPEndpointCheck=false raises an error",
587 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableOCSPEndpointCheck=false",
588 "valid": false,
589 "warning": false,
590 "hosts": null,
591 "auth": null,
592 "options": {}
593 },
594 {
595 "description": "tlsAllowInvalidCertificates=false and tlsDisableOCSPEndpointCheck=true raises an error",
596 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableOCSPEndpointCheck=true",
597 "valid": false,
598 "warning": false,
599 "hosts": null,
600 "auth": null,
601 "options": {}
602 },
603 {
604 "description": "tlsAllowInvalidCertificates and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
605 "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableOCSPEndpointCheck=false",
606 "valid": false,
607 "warning": false,
608 "hosts": null,
609 "auth": null,
610 "options": {}
611 },
612 {
613 "description": "tlsDisableOCSPEndpointCheck and tlsAllowInvalidCertificates both present (and true) raises an error",
614 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsAllowInvalidCertificates=true",
615 "valid": false,
616 "warning": false,
617 "hosts": null,
618 "auth": null,
619 "options": {}
620 },
621 {
622 "description": "tlsDisableOCSPEndpointCheck=true and tlsAllowInvalidCertificates=false raises an error",
623 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsAllowInvalidCertificates=false",
624 "valid": false,
625 "warning": false,
626 "hosts": null,
627 "auth": null,
628 "options": {}
629 },
630 {
631 "description": "tlsDisableOCSPEndpointCheck=false and tlsAllowInvalidCertificates=true raises an error",
632 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsAllowInvalidCertificates=true",
633 "valid": false,
634 "warning": false,
635 "hosts": null,
636 "auth": null,
637 "options": {}
638 },
639 {
640 "description": "tlsDisableOCSPEndpointCheck and tlsAllowInvalidCertificates both present (and false) raises an error",
641 "uri": "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsAllowInvalidCertificates=false",
642 "valid": false,
643 "warning": false,
644 "hosts": null,
645 "auth": null,
646 "options": {}
647 }
648 ]
649}
View as plain text