summaryrefslogtreecommitdiff
path: root/jstests/ssl
diff options
context:
space:
mode:
authorHai-Kinh Hoang <haikinh.hoang@mongodb.com>2016-08-10 10:57:32 -0400
committerHai-Kinh Hoang <haikinh.hoang@mongodb.com>2016-08-17 14:54:58 -0400
commitc267c7ad3573c82e9b463cc6f918e76bb921b292 (patch)
tree845209245734ed585b90a97735ca9e6f3301c403 /jstests/ssl
parent7f05ff5fd7fab804d8d84397714b308adec6fe1a (diff)
downloadmongo-c267c7ad3573c82e9b463cc6f918e76bb921b292.tar.gz
SERVER-25082 Allow x509 authentication without user/subject field
Diffstat (limited to 'jstests/ssl')
-rw-r--r--jstests/ssl/x509_client.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js
index 7e38bd3a713..5bcc83edef9 100644
--- a/jstests/ssl/x509_client.js
+++ b/jstests/ssl/x509_client.js
@@ -70,9 +70,15 @@ function authAndTest(mongo) {
"read without login");
assert(!external.auth({user: INVALID_CLIENT_USER, mechanism: 'MONGODB-X509'}),
- "authentication with invalid user failed");
+ "authentication with invalid user should fail");
assert(external.auth({user: CLIENT_USER, mechanism: 'MONGODB-X509'}),
"authentication with valid user failed");
+ assert(external.auth({mechanism: 'MONGODB-X509'}),
+ "authentication with valid client cert and no user field failed");
+ assert(external.runCommand({authenticate: 1, mechanism: 'MONGODB-X509', user: CLIENT_USER}).ok,
+ "runCommand authentication with valid client cert and user field failed");
+ assert(external.runCommand({authenticate: 1, mechanism: 'MONGODB-X509'}).ok,
+ "runCommand authentication with valid client cert and no user field failed");
// Check that we can add a user and read data
test.createUser(