diff OrthancServer/main.cpp @ 2219:262fcab24024

fix for HttpsCACertificates
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Dec 2016 11:06:41 +0100
parents 728403a6ec1f
children a3a65de1840f
line wrap: on
line diff
--- 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));