From c1a45ebbb0530e3d0201321d725527f1eb83ffce Mon Sep 17 00:00:00 2001 From: "clang-format-7.0.1" Date: Fri, 26 Jul 2019 18:42:24 -0400 Subject: Apply formatting per `clang-format-7.0.1` --- jstests/ssl/ssl_cn_with_san.js | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'jstests/ssl/ssl_cn_with_san.js') diff --git a/jstests/ssl/ssl_cn_with_san.js b/jstests/ssl/ssl_cn_with_san.js index 41e039c0a48..c033b935382 100644 --- a/jstests/ssl/ssl_cn_with_san.js +++ b/jstests/ssl/ssl_cn_with_san.js @@ -2,45 +2,45 @@ // does not permit connection, but provides a useful error. (function() { - 'use strict'; - load('jstests/ssl/libs/ssl_helpers.js'); +'use strict'; +load('jstests/ssl/libs/ssl_helpers.js'); - // server-intermediate-ca was signed by ca.pem, not trusted-ca.pem - const CA = 'jstests/libs/ca.pem'; - const SERVER = 'jstests/ssl/libs/localhost-cn-with-san.pem'; +// server-intermediate-ca was signed by ca.pem, not trusted-ca.pem +const CA = 'jstests/libs/ca.pem'; +const SERVER = 'jstests/ssl/libs/localhost-cn-with-san.pem'; - const mongod = MongoRunner.runMongod({ - sslMode: 'requireSSL', - sslPEMKeyFile: SERVER, - sslCAFile: CA, - }); - assert(mongod); +const mongod = MongoRunner.runMongod({ + sslMode: 'requireSSL', + sslPEMKeyFile: SERVER, + sslCAFile: CA, +}); +assert(mongod); - // Try with `tlsAllowInvalidHostnames` to look for the warning. +// Try with `tlsAllowInvalidHostnames` to look for the warning. +clearRawMongoProgramOutput(); +const mongo = runMongoProgram('mongo', + '--tls', + '--tlsCAFile', + CA, + 'localhost:' + mongod.port, + '--eval', + ';', + '--tlsAllowInvalidHostnames'); +assert.neq(mongo, 0, "Shell connected when it should have failed"); +assert(rawMongoProgramOutput().includes(' would have matched, but was overridden by SAN'), + 'Expected detail warning not seen'); + +// On OpenSSL only, start without `tlsAllowInvalidHostnames` +// Windowds/Mac will bail out too early to show this message. +if (determineSSLProvider() === 'openssl') { clearRawMongoProgramOutput(); - const mongo = runMongoProgram('mongo', - '--tls', - '--tlsCAFile', - CA, - 'localhost:' + mongod.port, - '--eval', - ';', - '--tlsAllowInvalidHostnames'); + const mongo = runMongoProgram( + 'mongo', '--tls', '--tlsCAFile', CA, 'localhost:' + mongod.port, '--eval', ';'); assert.neq(mongo, 0, "Shell connected when it should have failed"); - assert(rawMongoProgramOutput().includes(' would have matched, but was overridden by SAN'), + assert(rawMongoProgramOutput().includes( + 'CN: localhost would have matched, but was overridden by SAN'), 'Expected detail warning not seen'); +} - // On OpenSSL only, start without `tlsAllowInvalidHostnames` - // Windowds/Mac will bail out too early to show this message. - if (determineSSLProvider() === 'openssl') { - clearRawMongoProgramOutput(); - const mongo = runMongoProgram( - 'mongo', '--tls', '--tlsCAFile', CA, 'localhost:' + mongod.port, '--eval', ';'); - assert.neq(mongo, 0, "Shell connected when it should have failed"); - assert(rawMongoProgramOutput().includes( - 'CN: localhost would have matched, but was overridden by SAN'), - 'Expected detail warning not seen'); - } - - MongoRunner.stopMongod(mongod); +MongoRunner.stopMongod(mongod); })(); -- cgit v1.2.1