summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/ssl/libs/ssl_helpers.js13
-rw-r--r--jstests/sslSpecial/tls1_0.js (renamed from jstests/ssl/tls1_0.js)40
2 files changed, 31 insertions, 22 deletions
diff --git a/jstests/ssl/libs/ssl_helpers.js b/jstests/ssl/libs/ssl_helpers.js
index 37dad3972ee..78a9cd1daae 100644
--- a/jstests/ssl/libs/ssl_helpers.js
+++ b/jstests/ssl/libs/ssl_helpers.js
@@ -225,8 +225,21 @@ function detectDefaultTLSProtocol() {
sslDisabledProtocols: 'none',
useLogFiles: true,
tlsLogVersions: "TLS1_0,TLS1_1,TLS1_2,TLS1_3",
+ waitForConnect: true,
});
+ assert.eq(0,
+ runMongoProgram('mongo',
+ '--ssl',
+ '--port',
+ conn.port,
+ '--sslPEMKeyFile',
+ 'jstests/libs/client.pem',
+ '--sslCAFile',
+ 'jstests/libs/ca.pem',
+ '--eval',
+ ';'));
+
const res = conn.getDB("admin").serverStatus().transportSecurity;
MongoRunner.stopMongod(conn);
diff --git a/jstests/ssl/tls1_0.js b/jstests/sslSpecial/tls1_0.js
index 5c751d73f0f..4947f64e941 100644
--- a/jstests/ssl/tls1_0.js
+++ b/jstests/sslSpecial/tls1_0.js
@@ -41,39 +41,35 @@
sslMode: 'allowSSL',
sslPEMKeyFile: 'jstests/libs/server.pem',
sslCAFile: 'jstests/libs/ca.pem',
- waitForConnect: false
+ waitForConnect: true
};
if (serverDP !== null) {
serverOpts.sslDisabledProtocols = serverDP;
}
clearRawMongoProgramOutput();
const mongod = MongoRunner.runMongod(serverOpts);
- assert(mongod);
+ if (!mongod) {
+ assert(!shouldSucceed);
+ return;
+ }
let clientOpts = [];
if (clientDP !== null) {
clientOpts = ['--sslDisabledProtocols', clientDP];
}
- const didSucceed = (function() {
- try {
- assert.soon(function() {
- return 0 == runMongoProgram('mongo',
- '--ssl',
- '--port',
- mongod.port,
- '--sslPEMKeyFile',
- 'jstests/libs/client.pem',
- '--sslCAFile',
- 'jstests/libs/ca.pem',
- ...clientOpts,
- '--eval',
- ';');
- }, "Connecting to mongod", 30 * 1000);
- return true;
- } catch (e) {
- return false;
- }
- })();
+ const didSucceed = (0 == runMongoProgram('mongo',
+ '--ssl',
+ '--port',
+ mongod.port,
+ '--sslPEMKeyFile',
+ 'jstests/libs/client.pem',
+ '--sslCAFile',
+ 'jstests/libs/ca.pem',
+ ...clientOpts,
+ '--eval',
+ ';'));
+
+ MongoRunner.stopMongod(mongod);
// Exit code based success/failure.
assert.eq(