diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2017-12-20 13:17:03 -0500 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2017-12-20 15:56:30 -0500 |
commit | 3a16c3032d97117cda0ba4e4c75786d0c16807a5 (patch) | |
tree | 5ac581abc321a7ef288d1ed5e5a186e79cb93a22 /jstests/ssl | |
parent | 56362631390536f111f86a384e90e76631312f25 (diff) | |
download | mongo-3a16c3032d97117cda0ba4e4c75786d0c16807a5.tar.gz |
SERVER-32426 TransportLayer should honor current setParameter values
Diffstat (limited to 'jstests/ssl')
-rw-r--r-- | jstests/ssl/set_parameter_ssl.js | 13 |
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); } |