diff options
author | Kyle Erf <erf@mongodb.com> | 2013-12-12 15:16:14 -0500 |
---|---|---|
committer | Matt Kangas <matt.kangas@mongodb.com> | 2013-12-13 15:42:28 -0500 |
commit | 2c54682ce88e2c4e7fe8c99baeadfece0831dbd2 (patch) | |
tree | 9523bca472d92773cb6ef84593e3f62aa0649285 /jstests/ssl/mixed_mode_repl.js | |
parent | 779be6eeb263c9dab4072650602366e46d331b1b (diff) | |
download | mongo-2c54682ce88e2c4e7fe8c99baeadfece0831dbd2.tar.gz |
SERVER-11554: Added new tests for mixed mode ssl
Also added ssl testing library functions
Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Diffstat (limited to 'jstests/ssl/mixed_mode_repl.js')
-rw-r--r-- | jstests/ssl/mixed_mode_repl.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/ssl/mixed_mode_repl.js b/jstests/ssl/mixed_mode_repl.js new file mode 100644 index 00000000000..f87f8d4dcd6 --- /dev/null +++ b/jstests/ssl/mixed_mode_repl.js @@ -0,0 +1,23 @@ +// This test is related to mixed_mode_repl_nossl.js in +// the sslSpecial test set. This test must be run with --use-ssl + +// If we are running in use-x509 passthrough mode, turn it off +// since it is not necessary for this test. +TestData.useX509 = false; +load("jstests/ssl/libs/ssl_helpers.js") + +// Verify that requireSSL allows ssl connections +print("=== Testing requireSSL/requireSSL cluster ==="); +replShouldSucceed( requireSSL, requireSSL); + +// Test mixed sslMode allowSSL/preferSSL +print("=== Testing allowSSL/preferSSL cluster ==="); +replShouldSucceed(allowSSL, preferSSL); + +// Test mixed sslMode preferSSL/requireSSL +print("=== Testing preferSSL/requireSSL cluster ===") +replShouldSucceed( preferSSL, requireSSL); + +// Test mixed sslMode disabled/preferSSL - should fail +print("=== Testing allowSSL/requireSSL cluster - SHOULD FAIL ==="); +replShouldFail(allowSSL, requireSSL); |