summaryrefslogtreecommitdiff
path: root/jstests/ssl/ssl_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/ssl/ssl_options.js')
-rw-r--r--jstests/ssl/ssl_options.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/jstests/ssl/ssl_options.js b/jstests/ssl/ssl_options.js
index 1881114b482..571f854851b 100644
--- a/jstests/ssl/ssl_options.js
+++ b/jstests/ssl/ssl_options.js
@@ -2,11 +2,13 @@ var baseName = "jstests_ssl_ssl_options";
jsTest.log("Testing censorship of ssl options");
-var mongodConfig = { sslPEMKeyFile : "jstests/libs/password_protected.pem",
- sslMode : "requireSSL",
- sslPEMKeyPassword : "qwerty",
- sslClusterPassword : "qwerty",
- sslCAFile: "jstests/libs/ca.pem"};
+var mongodConfig = {
+ sslPEMKeyFile: "jstests/libs/password_protected.pem",
+ sslMode: "requireSSL",
+ sslPEMKeyPassword: "qwerty",
+ sslClusterPassword: "qwerty",
+ sslCAFile: "jstests/libs/ca.pem"
+};
var mongodSource = MongoRunner.runMongod(mongodConfig);
var getCmdLineOptsResult = mongodSource.adminCommand("getCmdLineOpts");
@@ -15,7 +17,8 @@ var i;
var isPassword = false;
for (i = 0; i < getCmdLineOptsResult.argv.length; i++) {
if (isPassword) {
- assert.eq(getCmdLineOptsResult.argv[i], "<password>",
+ assert.eq(getCmdLineOptsResult.argv[i],
+ "<password>",
"Password not properly censored: " + tojson(getCmdLineOptsResult));
isPassword = false;
continue;
@@ -26,9 +29,11 @@ for (i = 0; i < getCmdLineOptsResult.argv.length; i++) {
isPassword = true;
}
}
-assert.eq(getCmdLineOptsResult.parsed.net.ssl.PEMKeyPassword, "<password>",
+assert.eq(getCmdLineOptsResult.parsed.net.ssl.PEMKeyPassword,
+ "<password>",
"Password not properly censored: " + tojson(getCmdLineOptsResult));
-assert.eq(getCmdLineOptsResult.parsed.net.ssl.clusterPassword, "<password>",
+assert.eq(getCmdLineOptsResult.parsed.net.ssl.clusterPassword,
+ "<password>",
"Password not properly censored: " + tojson(getCmdLineOptsResult));
MongoRunner.stopMongod(mongodSource.port);