MCPcopy Create free account
hub / github.com/apache/arrow / ExampleTlsCertificateRoot

Function ExampleTlsCertificateRoot

cpp/src/arrow/flight/test_util.cc:301–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301Status ExampleTlsCertificateRoot(CertKeyPair* out) {
302 std::string root;
303 RETURN_NOT_OK(GetTestResourceRoot(&root));
304
305 std::stringstream path;
306 path << root << "/flight/root-ca.pem";
307
308 try {
309 std::ifstream cert_file(path.str());
310 if (!cert_file) {
311 return Status::IOError("Could not open certificate: " + path.str());
312 }
313 std::stringstream cert;
314 cert << cert_file.rdbuf();
315 out->pem_cert = cert.str();
316 out->pem_key = "";
317 return Status::OK();
318 } catch (const std::ifstream::failure& e) {
319 return Status::IOError(e.what());
320 }
321}
322
323} // namespace arrow::flight

Callers 2

ASSERT_OK_AND_ASSIGNMethod · 0.85
TEST_FMethod · 0.85

Calls 5

GetTestResourceRootFunction · 0.85
IOErrorFunction · 0.85
strMethod · 0.80
whatMethod · 0.80
OKFunction · 0.50

Tested by

no test coverage detected