19 #include <arrow/filesystem/s3fs.h>
20 #include <arrow/status.h>
21 #include <boost/filesystem.hpp>
23 #ifdef ARROW_HAS_PRIVATE_AWS_SDK
24 #include <aws/core/Aws.h>
29 #ifdef ARROW_HAS_PRIVATE_AWS_SDK
30 static Aws::SDKOptions awsapi_options;
35 arrow::fs::FileSystemGlobalOptions global_options;
36 global_options.tls_ca_dir_path = ssl_config.ca_path;
37 global_options.tls_ca_file_path = ssl_config.ca_file;
38 arrow::fs::Initialize(global_options);
39 arrow::fs::S3GlobalOptions s3_global_options;
40 s3_global_options.log_level = arrow::fs::S3LogLevel::Off;
41 auto status = arrow::fs::InitializeS3(s3_global_options);
42 CHECK(status.ok()) <<
"InitializeS3 resulted in an error: " << status.message();
43 #ifdef ARROW_HAS_PRIVATE_AWS_SDK
45 Aws::InitAPI(awsapi_options);
50 auto status = arrow::fs::FinalizeS3();
51 CHECK(status.ok()) <<
"FinalizeS3 resulted in an error: " << status.message();
52 #ifdef ARROW_HAS_PRIVATE_AWS_SDK
54 Aws::ShutdownAPI(awsapi_options);
70 std::list<std::string> v_known_ca_paths({
71 "/etc/ssl/certs/ca-certificates.crt",
72 "/etc/pki/tls/certs/ca-bundle.crt",
73 "/usr/share/ssl/certs/ca-bundle.crt",
74 "/usr/local/share/certs/ca-root.crt",
76 "/etc/ssl/ca-bundle.pem",
79 if (
nullptr != (env = getenv(
"SSL_CERT_DIR"))) {
82 if (
nullptr != (env = getenv(
"SSL_CERT_FILE"))) {
83 v_known_ca_paths.push_front(env);
85 for (
const auto& known_ca_path : v_known_ca_paths) {
86 if (boost::filesystem::exists(known_ca_path)) {
87 ssl_config.
ca_file = known_ca_path;
SslConfig get_ssl_config()