summaryrefslogtreecommitdiff
path: root/jstests/ssl/libs/ssl_x509_role_auth_utf8.js
blob: f94db33d27f60950db444afa6a4a199f381c164a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Helper script used to validate login as x509 auth with a certificate with roles works.
(function() {
    "use strict";

    // Authenticate against a certificate with a RDN in the subject name of type UTF8STRING
    const retutf8 = db.getSiblingDB("$external").auth({
        mechanism: "MONGODB-X509",
        user:
            "C=US,ST=New York,L=New York City,O=MongoDB,OU=Kernel Users,CN=\\D0\\9A\\D0\\B0\\D0\\BB\\D0\\BE\\D1\\8F\\D0\\BD"
    });
    assert.eq(retutf8, 1, "Auth failed");
}());