-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Networking & Observability
-
Fully Compatible
-
ALL
-
Security 2025-02-17
-
2
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Our SSLManager implementation will use the system certificate if no CA file is specified: https://github.com/10gen/mongo/blob/4ca59a150226875c1a96a4dbabb9a55a0a246cf9/src/mongo/util/net/ssl_manager_openssl.cpp#L3043
However, our gRPC implementation does not do this-- here is a unit test demonstrating this:
TEST_F(GRPCClientTest, GRPCClientConnectSystemCA) {
std::string sslCertFileOriginalEnv("");
if (auto res = getenv("SSL_CERT_FILE"); res != nullptr) {
sslCertFileOriginalEnv = std::string(res);
}
ON_BLOCK_EXIT([&]() { setenv("SSL_CERT_FILE", sslCertFileOriginalEnv.c_str(), 1); });
setenv("SSL_CERT_FILE", CommandServiceTestFixtures::kCAFile, 1);
auto options = CommandServiceTestFixtures::makeServerOptions();
auto clientThreadBody = [&](auto& server, auto& monitor) {
GRPCClient::Options options;
options.tlsCertificateKeyFile = CommandServiceTestFixtures::kClientCertificateKeyFile;
auto client = makeClient(std::move(options));
client->start();
auto session = client
->connect(server.getListeningAddresses().at(0),
getReactor(),
CommandServiceTestFixtures::kDefaultConnectTimeout,
{})
.get();
assertEchoSucceeds(*session);
ASSERT_OK(session->finish());
};
CommandServiceTestFixtures::runWithServer(
CommandServiceTestFixtures::makeEchoHandler(), clientThreadBody, std::move(options));
}
We should ask the gRPC team is this is a supported feature, and otherwise clearly reject this certificate setup in gRPC without blocking ASIO from using this setup.
- related to
-
SERVER-100612 Use native gRPC impl for getting system certificates with tlsUseSystemCA is specified
-
- Closed
-