changeset 371:c0b95d747337

Fix support for client certificate authentication
author Alain Mazy <alain@mazy.be>
date Mon, 28 Oct 2019 11:48:46 +0100
parents 23568e3f371c
children 771c63e3a429
files NEWS Plugin/DicomWebServers.cpp
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Oct 24 09:41:46 2019 +0200
+++ b/NEWS	Mon Oct 28 11:48:46 2019 +0100
@@ -13,6 +13,7 @@
 
 * Optimization of QIDO-RS for large studies/series
 * Fix handling of the "Forwarded" HTTP header
+* Fix support for client certificate authentication
 * Accept multiple MIME types in Accept header for WADO-RS "Retrieve Metadata"
 * Added explicit "Accept" header to avoid uncompressing DICOM files by Google cloud
   https://groups.google.com/d/msg/orthanc-users/w1Ekrsc6-U8/T2a_DoQ5CwAJ
--- a/Plugin/DicomWebServers.cpp	Thu Oct 24 09:41:46 2019 +0200
+++ b/Plugin/DicomWebServers.cpp	Mon Oct 28 11:48:46 2019 +0100
@@ -134,10 +134,20 @@
       client.SetCredentials(parameters.GetUsername(), parameters.GetPassword());
     }
 
+    if (!parameters.GetCertificateFile().empty())
+    {
+      client.SetClientCertificate(
+        parameters.GetCertificateFile(),
+        parameters.GetCertificateKeyFile(),
+        parameters.GetCertificateKeyPassword());
+    }
+
+    client.SetPkcs11Enabled(parameters.IsPkcs11Enabled());
+
     // By default, enable chunked transfers
     client.SetChunkedTransfersAllowed(
       parameters.GetBooleanUserProperty(HAS_CHUNKED_TRANSFERS, true));
-  }    
+  }
 
 
   void DicomWebServers::DeleteServer(const std::string& name)