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