summaryrefslogtreecommitdiff
path: root/jstests/ssl
diff options
context:
space:
mode:
authorShreyas Kalyan <shreyas.kalyan@10gen.com>2020-03-18 22:26:28 -0700
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-01 19:30:01 +0000
commitaf7f1e3a778a201a4bd6a372eb441b0f73b9c2ba (patch)
treede17d2096aac9ef7754127f95966e0ee515a94a2 /jstests/ssl
parent120555f4df938ff61110a63eeccadf9c3068d24b (diff)
downloadmongo-af7f1e3a778a201a4bd6a372eb441b0f73b9c2ba.tar.gz
SERVER-46950 Add message-strings for TLS
Diffstat (limited to 'jstests/ssl')
-rw-r--r--jstests/ssl/ssl_cert_selector_apple.js4
-rw-r--r--jstests/ssl/ssl_client_certificate_warning_suppression.js4
-rw-r--r--jstests/ssl/ssl_count_protocols.js7
-rw-r--r--jstests/ssl/ssl_withhold_client_cert.js2
4 files changed, 10 insertions, 7 deletions
diff --git a/jstests/ssl/ssl_cert_selector_apple.js b/jstests/ssl/ssl_cert_selector_apple.js
index aa836e74d2e..66c917674de 100644
--- a/jstests/ssl/ssl_cert_selector_apple.js
+++ b/jstests/ssl/ssl_cert_selector_apple.js
@@ -47,8 +47,8 @@ requireSSLProvider('apple', function() {
return log.search('Certificate selector returned no results') >= 0;
}
// Valid search criteria should show our Subject Names.
- const certOK = log.search('\"config_serverSubjectName\":\"' + cert.name) >= 0;
- const clusOK = log.search('\"config_clientSubjectName\":\"' + cluster.name) >= 0;
+ const certOK = log.search('\"name\":\"' + cert.name) >= 0;
+ const clusOK = log.search('\"name\":\"' + cluster.name) >= 0;
return certOK && clusOK;
}, "Starting Mongod with " + tojson(opts), 10000);
diff --git a/jstests/ssl/ssl_client_certificate_warning_suppression.js b/jstests/ssl/ssl_client_certificate_warning_suppression.js
index 4531b4f1bc4..faf987d9bad 100644
--- a/jstests/ssl/ssl_client_certificate_warning_suppression.js
+++ b/jstests/ssl/ssl_client_certificate_warning_suppression.js
@@ -1,6 +1,6 @@
/**
* Tests the startup-only setParameter value suppressNoTLSPeerCertificateWarning which suppresses
- * the log message "no SSL certificate provided by peer" when a client certificate is not provided.
+ * the log message "No SSL certificate provided by peer" when a client certificate is not provided.
* This only works if weak validation is enabled.
*
* This test confirms that the log message is output when the setParameter is set to true,
@@ -49,7 +49,7 @@ function test(suppress) {
// Now check for the message
const log = rawMongoProgramOutput();
- assert.eq(suppress, log.search('no SSL certificate provided by peer') === -1);
+ assert.eq(suppress, log.match(/[N,n]o SSL certificate provided by peer/) === null);
try {
MongoRunner.stopMongod(mongod);
diff --git a/jstests/ssl/ssl_count_protocols.js b/jstests/ssl/ssl_count_protocols.js
index 0b550275ca0..80426002c29 100644
--- a/jstests/ssl/ssl_count_protocols.js
+++ b/jstests/ssl/ssl_count_protocols.js
@@ -78,9 +78,12 @@ function runTestWithoutSubset(client) {
const lines = log.split('\n');
let found = false;
for (let logMsg of lines) {
+ if (!logMsg) {
+ continue;
+ }
const logJson = JSON.parse(logMsg);
- if (logJson.id === 23218 && /1\.\d/.test(logJson.attr.version) &&
- /127.0.0.1:\d+/.test(logJson.attr.connection)) {
+ if (logJson.id === 23218 && /1\.\d/.test(logJson.attr.tlsVersion) &&
+ /127.0.0.1:\d+/.test(logJson.attr.remoteHost)) {
found = true;
break;
}
diff --git a/jstests/ssl/ssl_withhold_client_cert.js b/jstests/ssl/ssl_withhold_client_cert.js
index c83dff3a717..75d485205cb 100644
--- a/jstests/ssl/ssl_withhold_client_cert.js
+++ b/jstests/ssl/ssl_withhold_client_cert.js
@@ -18,7 +18,7 @@ function testRS(opts, expectWarning) {
function checkWarning(member) {
const observed =
- /no SSL certificate provided by peer/.test(cat(member.fullOptions.logFile));
+ /[N,n]o SSL certificate provided by peer/.test(cat(member.fullOptions.logFile));
assert.eq(observed, expectWarning);
}
checkWarning(rs.getPrimary());