changeset 2219:262fcab24024

fix for HttpsCACertificates
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Dec 2016 11:06:41 +0100
parents 3eefb84ac0bd
children 0fb6e0461105
files Core/HttpClient.cpp OrthancServer/main.cpp
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Core/HttpClient.cpp	Tue Dec 13 10:27:20 2016 +0100
+++ b/Core/HttpClient.cpp	Tue Dec 13 11:06:41 2016 +0100
@@ -318,10 +318,10 @@
     url_ = "";
     method_ = HttpMethod_Get;
     lastStatus_ = HttpStatus_200_Ok;
-    isVerbose_ = false;
+    SetVerbose(false);
     timeout_ = GlobalParameters::GetInstance().GetDefaultTimeout();
     GlobalParameters::GetInstance().GetDefaultProxy(proxy_);
-    GlobalParameters::GetInstance().GetSslConfiguration(verifyPeers_, caCertificates_);
+    GlobalParameters::GetInstance().GetSslConfiguration(verifyPeers_, caCertificates_);    
   }
 
 
--- a/OrthancServer/main.cpp	Tue Dec 13 10:27:20 2016 +0100
+++ b/OrthancServer/main.cpp	Tue Dec 13 11:06:41 2016 +0100
@@ -934,15 +934,18 @@
                                    IStorageArea& storageArea,
                                    OrthancPlugins *plugins)
 {
-  ServerContext context(database, storageArea);
-
+  // These configuration options must be set before creating the
+  // ServerContext, otherwise the possible Lua scripts will not be
+  // able to properly issue HTTP/HTTPS queries
   HttpClient::ConfigureSsl(Configuration::GetGlobalBoolParameter("HttpsVerifyPeers", true),
-                           Configuration::GetGlobalStringParameter("HttpsCACertificates", ""));
+                           Configuration::InterpretStringParameterAsPath
+                           (Configuration::GetGlobalStringParameter("HttpsCACertificates", "")));
   HttpClient::SetDefaultTimeout(Configuration::GetGlobalUnsignedIntegerParameter("HttpTimeout", 0));
   HttpClient::SetDefaultProxy(Configuration::GetGlobalStringParameter("HttpProxy", ""));
 
   DicomUserConnection::SetDefaultTimeout(Configuration::GetGlobalUnsignedIntegerParameter("DicomScuTimeout", 10));
 
+  ServerContext context(database, storageArea);
   context.SetCompressionEnabled(Configuration::GetGlobalBoolParameter("StorageCompression", false));
   context.SetStoreMD5ForAttachments(Configuration::GetGlobalBoolParameter("StoreMD5ForAttachments", true));