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 auto status = arrow::fs::InitializeS3(s3_global_options);
41 CHECK(status.ok()) <<
"InitializeS3 resulted in an error: " << status.message();
42 #ifdef ARROW_HAS_PRIVATE_AWS_SDK
44 Aws::InitAPI(awsapi_options);
49 auto status = arrow::fs::FinalizeS3();
50 CHECK(status.ok()) <<
"FinalizeS3 resulted in an error: " << status.message();
51 #ifdef ARROW_HAS_PRIVATE_AWS_SDK
53 Aws::ShutdownAPI(awsapi_options);
69 std::list<std::string> v_known_ca_paths({
70 "/etc/ssl/certs/ca-certificates.crt",
71 "/etc/pki/tls/certs/ca-bundle.crt",
72 "/usr/share/ssl/certs/ca-bundle.crt",
73 "/usr/local/share/certs/ca-root.crt",
75 "/etc/ssl/ca-bundle.pem",
78 if (
nullptr != (env = getenv(
"SSL_CERT_DIR"))) {
81 if (
nullptr != (env = getenv(
"SSL_CERT_FILE"))) {
82 v_known_ca_paths.push_front(env);
84 for (
const auto& known_ca_path : v_known_ca_paths) {
85 if (boost::filesystem::exists(known_ca_path)) {
86 ssl_config.
ca_file = known_ca_path;
SslConfig get_ssl_config()