mongo/jstests/ssl/macos_encrypted_pem.js
Gabriel Marks 77d90a66d3 SERVER-99750 Use generated certificates in jstests (#46650)
GitOrigin-RevId: 303ffa3be9ec56f70a9ff9e38d4430fd0c927599
2026-01-28 18:44:45 +00:00

24 lines
790 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: getX509Path("password_protected.pem"),
tlsMode: "requireTLS",
tlsCertificateKeyFilePassword: "qwerty",
tlsCAFile: getX509Path("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,
);
});