summaryrefslogtreecommitdiff
path: root/jstests/ssl
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2017-12-20 13:17:03 -0500
committerJonathan Reams <jbreams@mongodb.com>2017-12-20 15:56:30 -0500
commit3a16c3032d97117cda0ba4e4c75786d0c16807a5 (patch)
tree5ac581abc321a7ef288d1ed5e5a186e79cb93a22 /jstests/ssl
parent56362631390536f111f86a384e90e76631312f25 (diff)
downloadmongo-3a16c3032d97117cda0ba4e4c75786d0c16807a5.tar.gz
SERVER-32426 TransportLayer should honor current setParameter values
Diffstat (limited to 'jstests/ssl')
-rw-r--r--jstests/ssl/set_parameter_ssl.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/ssl/set_parameter_ssl.js b/jstests/ssl/set_parameter_ssl.js
index a07db207b79..39b0e0040a9 100644
--- a/jstests/ssl/set_parameter_ssl.js
+++ b/jstests/ssl/set_parameter_ssl.js
@@ -13,6 +13,19 @@ function testSSLTransition(oldMode, newMode, shouldSucceed) {
var res = adminDB.runCommand({"setParameter": 1, "sslMode": newMode});
assert(res["ok"] == shouldSucceed, tojson(res));
+ if (!shouldSucceed) {
+ MongoRunner.stopMongod(conn);
+ return;
+ }
+
+ if (newMode != "requireSSL") {
+ MongoRunner.stopMongod(conn);
+ return;
+ }
+
+ let uri = `mongodb://localhost:${conn.port}/admin`;
+ let exitCode = runMongoProgram("mongo", uri, "--eval", "assert.commandWorked(db.isMaster())");
+ assert.neq(exitCode, 0, "Was able to connect without SSL when SSLMode was requireSSL");
MongoRunner.stopMongod(conn);
}