| 86 | std::string MinioTestServer::scheme() const { return impl_->scheme_; } |
| 87 | |
| 88 | Status MinioTestServer::GenerateCertificateFile() { |
| 89 | // create the dedicated folder for certificate file, rather than reuse the data |
| 90 | // folder, since there is test case to check whether the folder is empty. |
| 91 | ARROW_ASSIGN_OR_RAISE(impl_->temp_dir_ca_, TemporaryDir::Make("s3fs-test-ca-")); |
| 92 | |
| 93 | ARROW_ASSIGN_OR_RAISE(auto public_crt_file, |
| 94 | PlatformFilename::FromString(ca_dir_path() + "/public.crt")); |
| 95 | ARROW_ASSIGN_OR_RAISE(auto public_cert_fd, FileOpenWritable(public_crt_file)); |
| 96 | ARROW_RETURN_NOT_OK(FileWrite(public_cert_fd.fd(), |
| 97 | reinterpret_cast<const uint8_t*>(kMinioCert), |
| 98 | strlen(kMinioCert))); |
| 99 | ARROW_RETURN_NOT_OK(public_cert_fd.Close()); |
| 100 | |
| 101 | ARROW_ASSIGN_OR_RAISE(auto private_key_file, |
| 102 | PlatformFilename::FromString(ca_dir_path() + "/private.key")); |
| 103 | ARROW_ASSIGN_OR_RAISE(auto private_key_fd, FileOpenWritable(private_key_file)); |
| 104 | ARROW_RETURN_NOT_OK(FileWrite(private_key_fd.fd(), |
| 105 | reinterpret_cast<const uint8_t*>(kMinioPrivateKey), |
| 106 | strlen(kMinioPrivateKey))); |
| 107 | ARROW_RETURN_NOT_OK(private_key_fd.Close()); |
| 108 | |
| 109 | return Status::OK(); |
| 110 | } |
| 111 | |
| 112 | Status MinioTestServer::Start(bool enable_tls) { |
| 113 | const char* connect_str = std::getenv(kEnvConnectString); |