diff Aws/AwsS3StoragePlugin.cpp @ 27:e1f52b851827

Added "VirtualAddressing" configuration option in the AWS S3 plugin (for compatibility with minio)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 07 Sep 2020 17:16:38 +0200
parents 2a02b21f0a19
children 70da4ce5c7cc
line wrap: on
line diff
--- a/Aws/AwsS3StoragePlugin.cpp	Mon Sep 07 16:00:59 2020 +0200
+++ b/Aws/AwsS3StoragePlugin.cpp	Mon Sep 07 17:16:38 2020 +0200
@@ -226,7 +226,8 @@
   std::string endpoint = pluginSection.GetStringValue("Endpoint", "");
   unsigned int connectTimeout = pluginSection.GetUnsignedIntegerValue("ConnectTimeout", 30);
   unsigned int requestTimeout = pluginSection.GetUnsignedIntegerValue("RequestTimeout", 1200);
-
+  bool virtualAddressing = pluginSection.GetBooleanValue("VirtualAddressing", true);
+  
   try
   {
     Aws::SDKOptions options;
@@ -238,13 +239,14 @@
     configuration.scheme = Aws::Http::Scheme::HTTPS;
     configuration.connectTimeoutMs = connectTimeout * 1000;
     configuration.requestTimeoutMs  = requestTimeout * 1000;
+    configuration.httpRequestTimeoutMs = requestTimeout * 1000;
 
     if (!endpoint.empty())
     {
       configuration.endpointOverride = endpoint.c_str();
     }
 
-    Aws::S3::S3Client client(credentials, configuration);
+    Aws::S3::S3Client client(credentials, configuration, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never, virtualAddressing);
 
     OrthancPlugins::LogInfo("AWS S3 storage initialized");