Files
mongo/jstests/ssl/macos_encrypted_pem.js
W. Brad Moore 3cbd53553c SERVER-84397: Use proper SSL options in tests
GitOrigin-RevId: 2ceb3b5faa6e0038e0f6d2f4326241b735b83535
2024-02-01 15:32:18 +00:00

21 lines
772 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);
});