| 299 | } |
| 300 | |
| 301 | Status 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 |
no test coverage detected