summaryrefslogtreecommitdiff
path: root/jstests/ssl
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2016-04-04 13:34:32 -0400
committerJonathan Reams <jbreams@mongodb.com>2016-04-04 13:34:32 -0400
commitaf651b2a9714e0a07b90c98154f7c3dd8d012f66 (patch)
tree123d56a54d3bc3de384e12c3252f13ecb7af3f2e /jstests/ssl
parent22e4df34c0f7a54bbb847f0b13507d54dc0e9cbd (diff)
downloadmongo-af651b2a9714e0a07b90c98154f7c3dd8d012f66.tar.gz
Revert "SERVER-23044 Fall back to system CA certs if CA file isn't provided"
This reverts commit 22e4df34c0f7a54bbb847f0b13507d54dc0e9cbd.
Diffstat (limited to 'jstests/ssl')
-rw-r--r--jstests/ssl/ssl_with_system_ca.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/jstests/ssl/ssl_with_system_ca.js b/jstests/ssl/ssl_with_system_ca.js
deleted file mode 100644
index 00eb423ee62..00000000000
--- a/jstests/ssl/ssl_with_system_ca.js
+++ /dev/null
@@ -1,39 +0,0 @@
-((function() {
- 'use strict';
- const HOST_TYPE = getBuildInfo().buildEnvironment.target_os;
-
- if (HOST_TYPE == "windows") {
- runProgram(
- "certutil.exe", "-addstore", "-user", "-f", "CA", "jstests\\libs\\trusted-ca.pem");
- }
-
- var testWithCerts = function(serverPem) {
- jsTest.log(`Testing with SSL certs $ {
- serverPem
- }`);
- // allowSSL instead of requireSSL so that the non-SSL connection succeeds.
- var conn = MongoRunner.runMongod(
- {sslMode: 'requireSSL', sslPEMKeyFile: "jstests/libs/" + serverPem});
-
- // Should not be able to authenticate with x509.
- // Authenticate call will return 1 on success, 0 on error.
- var argv =
- ['./mongo', '--ssl', '--port', conn.port, '--eval', ('db.runCommand({buildInfo: 1})')];
- if (HOST_TYPE == "linux") {
- // On Linux we override the default path to the system CA store to point to our
- // "trusted" CA. On Windows, this CA will have been added to the user's trusted CA list
- argv.unshift("env", "SSL_CERT_FILE=jstests/libs/trusted-ca.pem");
- }
- var exitStatus = runMongoProgram.apply(null, argv);
- assert.eq(exitStatus, 0, "successfully connected with SSL");
-
- MongoRunner.stopMongod(conn.port);
- };
-
- assert.throws(function() {
- testWithCerts("server.pem", "client.pem");
- });
- assert.doesNotThrow(function() {
- testWithCerts("trusted-server.pem", "trusted-client.pem");
- });
-})());