diff OrthancFramework/Sources/DicomNetworking/RemoteModalityParameters.cpp @ 4438:4a4e33c9082d

configuration options for DICOM TLS in Orthanc SCU
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Jan 2021 16:53:35 +0100
parents d9473bd5ed43
children 522e13a60cfc
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/RemoteModalityParameters.cpp	Wed Jan 06 17:27:28 2021 +0100
+++ b/OrthancFramework/Sources/DicomNetworking/RemoteModalityParameters.cpp	Thu Jan 07 16:53:35 2021 +0100
@@ -36,14 +36,15 @@
 static const char* KEY_ALLOW_FIND = "AllowFind";
 static const char* KEY_ALLOW_GET = "AllowGet";
 static const char* KEY_ALLOW_MOVE = "AllowMove";
-static const char* KEY_ALLOW_STORE = "AllowStore";
 static const char* KEY_ALLOW_N_ACTION = "AllowNAction";
 static const char* KEY_ALLOW_N_EVENT_REPORT = "AllowEventReport";
 static const char* KEY_ALLOW_STORAGE_COMMITMENT = "AllowStorageCommitment";
+static const char* KEY_ALLOW_STORE = "AllowStore";
 static const char* KEY_ALLOW_TRANSCODING = "AllowTranscoding";
 static const char* KEY_HOST = "Host";
 static const char* KEY_MANUFACTURER = "Manufacturer";
 static const char* KEY_PORT = "Port";
+static const char* KEY_USE_DICOM_TLS = "UseDicomTls";
 
 
 namespace Orthanc
@@ -62,6 +63,7 @@
     allowNAction_ = true;  // For storage commitment
     allowNEventReport_ = true;  // For storage commitment
     allowTranscoding_ = true;
+    useDicomTls_ = false;
   }
 
 
@@ -279,6 +281,11 @@
     {
       allowTranscoding_ = SerializationToolbox::ReadBoolean(serialized, KEY_ALLOW_TRANSCODING);
     }
+
+    if (serialized.isMember(KEY_USE_DICOM_TLS))
+    {
+      useDicomTls_ = SerializationToolbox::ReadBoolean(serialized, KEY_USE_DICOM_TLS);
+    }
   }
 
 
@@ -361,7 +368,8 @@
             !allowMove_ ||
             !allowNAction_ ||
             !allowNEventReport_ ||
-            !allowTranscoding_);
+            !allowTranscoding_ ||
+            useDicomTls_);
   }
 
   
@@ -384,6 +392,7 @@
       target[KEY_ALLOW_N_ACTION] = allowNAction_;
       target[KEY_ALLOW_N_EVENT_REPORT] = allowNEventReport_;
       target[KEY_ALLOW_TRANSCODING] = allowTranscoding_;
+      target[KEY_USE_DICOM_TLS] = useDicomTls_;
     }
     else
     {
@@ -424,4 +433,14 @@
   {
     allowTranscoding_ = allowed;
   }
+
+  bool RemoteModalityParameters::IsDicomTlsEnabled() const
+  {
+    return useDicomTls_;
+  }
+
+  void RemoteModalityParameters::SetDicomTlsEnabled(bool enabled)
+  {
+    useDicomTls_ = enabled;
+  }
 }