diff Plugins/Engine/OrthancPlugins.cpp @ 2019:9c9332e486ca

HTTPS client certificates can be associated with Orthanc peers to enhance security over Internet
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 14 Jun 2016 17:53:23 +0200
parents 50b9bc19dc62
children fefbe71c2272
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp	Tue Jun 14 15:51:00 2016 +0200
+++ b/Plugins/Engine/OrthancPlugins.cpp	Tue Jun 14 17:53:23 2016 +0200
@@ -1793,6 +1793,24 @@
       client.SetCredentials(p.username, p.password);
     }
 
+    if (p.certificateFile != NULL)
+    {
+      std::string certificate(p.certificateFile);
+      std::string key, password;
+
+      if (p.certificateKeyFile)
+      {
+        key.assign(p.certificateKeyFile);
+      }
+
+      if (p.certificateKeyPassword)
+      {
+        password.assign(p.certificateKeyPassword);
+      }
+
+      client.SetClientCertificate(certificate, key, password);
+    }
+
     for (uint32_t i = 0; i < p.headersCount; i++)
     {
       if (p.headersKeys[i] == NULL ||