0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 00:17:37 +01:00
mongodb/jstests/ssl/macos_encrypted_pem.js
Moustafa Maher be39a8421f SERVER-95628 Make rawMongoProgramOutput more robust (#28204)
GitOrigin-RevId: 6b01ab93e5ba70a22cc816931cd464b6f2ddbd13
2024-10-22 22:40:58 +00:00

21 lines
776 B
JavaScript

// Test macOS refusing to start up with encrypted PEM file.
import {requireSSLProvider} from "jstests/ssl/libs/ssl_helpers.js";
requireSSLProvider('apple', function() {
jsTest.log("Verifying that mongod will fail to start using an encrypted PEM file");
const config = MongoRunner.mongodOptions({
tlsCertificateKeyFile: "jstests/libs/password_protected.pem",
tlsMode: "requireTLS",
tlsCertificateKeyFilePassword: "qwerty",
tlsCAFile: "jstests/libs/ca.pem",
});
assert.throws(() => MongoRunner.runMongod(config), [], "MongoD unexpectedly started up");
assert.eq(rawMongoProgramOutput(".*").includes(
"Using encrypted PKCS#1/PKCS#8 PEM files is not supported on this platform"),
true);
});