diff options
Diffstat (limited to 'jstests/ssl/x509_client.js')
-rw-r--r-- | jstests/ssl/x509_client.js | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js index c2329554e3f..c2c15f7b567 100644 --- a/jstests/ssl/x509_client.js +++ b/jstests/ssl/x509_client.js @@ -1,10 +1,9 @@ -// If we are running in use-x509 passthrough mode, turn it off or else the auth -// part of this test will not work correctly - -TestData.useX509 = false; - // Check if this build supports the authenticationMechanisms startup parameter. -var conn = MongoRunner.runMongod({ smallfiles: "", auth: "" }); +var conn = MongoRunner.runMongod({smallfiles: "", + auth: "", + sslMode: "requireSSL", + sslPEMKeyFile: "jstests/libs/server.pem", + sslCAFile: "jstests/libs/ca.pem"}); conn.getDB('admin').createUser({user: "root", pwd: "pass", roles: ["root"]}); conn.getDB('admin').auth("root", "pass"); var cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1}) @@ -50,19 +49,16 @@ function authAndTest(mongo) { } print("1. Testing x.509 auth to mongod"); -var mongo = MongoRunner.runMongod({port : port, - sslMode : "requireSSL", - sslPEMKeyFile : SERVER_CERT, - sslCAFile : CA_CERT, - auth:""}); +var x509_options = {sslMode : "requireSSL", + sslPEMKeyFile : SERVER_CERT, + sslCAFile : CA_CERT}; + +var mongo = MongoRunner.runMongod(Object.merge(x509_options, {port: port, auth: ""})); authAndTest(mongo); -stopMongod(port); +MongoRunner.stopMongod(port); print("2. Testing x.509 auth to mongos"); -var x509_options = {sslMode : "requireSSL", - sslPEMKeyFile : SERVER_CERT, - sslCAFile : CA_CERT}; var st = new ShardingTest({ shards : 1, mongos : 1, @@ -70,6 +66,7 @@ var st = new ShardingTest({ shards : 1, extraOptions : {"keyFile" : "jstests/libs/key1"}, configOptions : x509_options, mongosOptions : x509_options, + shardOptions : x509_options, }}); authAndTest(new Mongo("localhost:" + st.s0.port)) |