{
"tests": [
{
"description": "Valid required tls options are parsed correctly",
"uri": "mongodb://example.com/?tls=true&tlsCAFile=ca.pem&tlsCertificateKeyFile=cert.pem&tlsCertificateKeyFilePassword=hunter2",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"tls": true,
"tlsCAFile": "ca.pem",
"tlsCertificateKeyFile": "cert.pem",
"tlsCertificateKeyFilePassword": "hunter2"
}
},
{
"description": "Invalid tlsAllowInvalidCertificates causes a warning",
"uri": "mongodb://example.com/?tlsAllowInvalidCertificates=invalid",
"valid": true,
"warning": true,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsAllowInvalidCertificates is parsed correctly",
"uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"tlsAllowInvalidCertificates": true
}
},
{
"description": "Invalid tlsAllowInvalidCertificates causes a warning",
"uri": "mongodb://example.com/?tlsAllowInvalidCertificates=invalid",
"valid": true,
"warning": true,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsAllowInvalidHostnames is parsed correctly",
"uri": "mongodb://example.com/?tlsAllowInvalidHostnames=true",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"tlsAllowInvalidHostnames": true
}
},
{
"description": "Invalid tlsAllowInvalidHostnames causes a warning",
"uri": "mongodb://example.com/?tlsAllowInvalidHostnames=invalid",
"valid": true,
"warning": true,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsInsecure is parsed correctly",
"uri": "mongodb://example.com/?tlsInsecure=true",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"tlsInsecure": true
}
},
{
"description": "Invalid tlsAllowInsecure causes a warning",
"uri": "mongodb://example.com/?tlsAllowInsecure=invalid",
"valid": true,
"warning": true,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsInsecure and tlsAllowInvalidCertificates both present (and true) raises an error",
"uri": "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidCertificates=true",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsInsecure and tlsAllowInvalidCertificates both present (and false) raises an error",
"uri": "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidCertificates=false",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsAllowInvalidCertificates and tlsInsecure both present (and true) raises an error",
"uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsInsecure=true",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsAllowInvalidCertificates and tlsInsecure both present (and false) raises an error",
"uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsInsecure=false",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsInsecure and tlsAllowInvalidHostnames both present (and true) raises an error",
"uri": "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidHostnames=true",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsInsecure and tlsAllowInvalidHostnames both present (and false) raises an error",
"uri": "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidHostnames=false",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsAllowInvalidHostnames and tlsInsecure both present (and true) raises an error",
"uri": "mongodb://example.com/?tlsAllowInvalidHostnames=true&tlsInsecure=true",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tlsAllowInvalidHostnames and tlsInsecure both present (and false) raises an error",
"uri": "mongodb://example.com/?tlsAllowInvalidHostnames=false&tlsInsecure=false",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tls=true and ssl=true doesn't warn",
"uri": "mongodb://example.com/?tls=true&ssl=true",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tls=false and ssl=false doesn't warn",
"uri": "mongodb://example.com/?tls=false&ssl=false",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "ssl=true and tls=true doesn't warn",
"uri": "mongodb://example.com/?ssl=true&tls=true",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "ssl=false and tls=false doesn't warn",
"uri": "mongodb://example.com/?ssl=false&tls=false",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tls=false and ssl=true raises error",
"uri": "mongodb://example.com/?tls=false&ssl=true",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "tls=true and ssl=false raises error",
"uri": "mongodb://example.com/?tls=true&ssl=false",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "ssl=false and tls=true raises error",
"uri": "mongodb://example.com/?ssl=false&tls=true",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "ssl=true and tls=false raises error",
"uri": "mongodb://example.com/?ssl=true&tls=false",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
}
]
}