Files
mongo/jstests/ssl/ssl_invalid_disabled_protocols.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

30 lines
913 B
JavaScript

import {CA_CERT, SERVER_CERT} from "jstests/ssl/libs/ssl_helpers.js";
function allDisabledProtocols() {
jsTestLog(`All Protocols Disabled, Should Throw Error`);
const opts = {
tlsMode: "requireTLS",
tlsCertificateKeyFile: SERVER_CERT,
tlsCAFile: CA_CERT,
sslDisabledProtocols: "TLS1_0,TLS1_1,TLS1_2,TLS1_3", // Disabling all TLS protocols
};
clearRawMongoProgramOutput();
assert.throws(() => {
MongoRunner.runMongod(opts);
});
}
allDisabledProtocols();
function oneEnabledProtocol() {
jsTestLog(`TLS1_2 Enabled, Should Pass`);
const opts = {
tlsMode: "requireTLS",
tlsCertificateKeyFile: SERVER_CERT,
tlsCAFile: CA_CERT,
sslDisabledProtocols: "TLS1_0,TLS1_1,TLS1_3", // Disabling 0, 1, and 3
};
const mongod = MongoRunner.runMongod(opts);
MongoRunner.stopMongod(mongod);
}
oneEnabledProtocol();