summaryrefslogtreecommitdiff
path: root/jstests/ssl
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2020-02-28 12:52:03 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-28 18:11:34 +0000
commitf5e1ac9ee73195754bc39f103c3817d917e9da11 (patch)
treed34eecd89b477de13a6a3ff974d2a7c6ee0e6753 /jstests/ssl
parent4d5cf5f7d9b396545b2b83936ea04697f58b4428 (diff)
downloadmongo-f5e1ac9ee73195754bc39f103c3817d917e9da11.tar.gz
SERVER-46385 Complete TODO listed in SERVER-46018
Diffstat (limited to 'jstests/ssl')
-rw-r--r--jstests/ssl/x509_client.js15
-rw-r--r--jstests/ssl/x509_expiring.js13
2 files changed, 9 insertions, 19 deletions
diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js
index 568b85d9b33..cd077165b4b 100644
--- a/jstests/ssl/x509_client.js
+++ b/jstests/ssl/x509_client.js
@@ -78,16 +78,11 @@ function authAndTest(mongo) {
if (isJsonLog(mongo)) {
function checkAuthSuccess(element, index, array) {
- // TODO SERVER-46018: Parse can show because RamLog may return a truncated log
- try {
- const logJson = JSON.parse(element);
-
- return logJson.id === 20429 && logJson.attr.principalName === CLIENT_USER &&
- logJson.attr.DB === "$external" &&
- /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(logJson.attr.client);
- } catch (exception) {
- return false;
- }
+ const logJson = JSON.parse(element);
+
+ return logJson.id === 20429 && logJson.attr.principalName === CLIENT_USER &&
+ logJson.attr.DB === "$external" &&
+ /(?:\d{1,3}\.){3}\d{1,3}:\d+/.test(logJson.attr.client);
}
assert(log.some(checkAuthSuccess));
} else {
diff --git a/jstests/ssl/x509_expiring.js b/jstests/ssl/x509_expiring.js
index 1c2ef47e838..526ffb3ed6d 100644
--- a/jstests/ssl/x509_expiring.js
+++ b/jstests/ssl/x509_expiring.js
@@ -38,15 +38,10 @@ function test(expiration, expect) {
if (isJsonLog(mongo)) {
function checkPeerCertificateExpires(element, index, array) {
- // TODO SERVER-46018: Parse can show because RamLog may return a truncated log
- try {
- const logJson = JSON.parse(element);
-
- return (logJson.id === 23221 || logJson.id === 23222) &&
- logJson.attr.peerSubjectName === CLIENT_USER;
- } catch (exception) {
- return false;
- }
+ const logJson = JSON.parse(element);
+
+ return (logJson.id === 23221 || logJson.id === 23222) &&
+ logJson.attr.peerSubjectName === CLIENT_USER;
}
assert.eq(log.some(checkPeerCertificateExpires), expect);
} else {