diff Applications/DicomToTiff.cpp @ 125:7a3f4d580625

SSL is enabled by default for HTTPS transfers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Feb 2018 17:34:35 +0100
parents a51dee6a1515
children 788dd04b87f5
line wrap: on
line diff
--- a/Applications/DicomToTiff.cpp	Mon Jan 15 09:36:39 2018 +0100
+++ b/Applications/DicomToTiff.cpp	Fri Feb 02 17:34:35 2018 +0100
@@ -31,8 +31,6 @@
 
 #include "ApplicationToolbox.h"
 
-#include <boost/program_options.hpp>
-
 
 static bool ParseParameters(int& exitStatus,
                             boost::program_options::variables_map& options,
@@ -51,9 +49,8 @@
   source.add_options()
     ("orthanc", boost::program_options::value<std::string>()->default_value("http://localhost:8042/"),
      "URL to the REST API of the target Orthanc server")
-    ("username", boost::program_options::value<std::string>(), "Username for the target Orthanc server")
-    ("password", boost::program_options::value<std::string>(), "Password for the target Orthanc server")
     ;
+  OrthancWSI::ApplicationToolbox::AddRestApiOptions(source);
 
   boost::program_options::options_description target("Options for the target TIFF image");
   target.add_options()
@@ -286,20 +283,7 @@
     {
       Orthanc::WebServiceParameters params;
 
-      if (options.count("orthanc"))
-      {
-        params.SetUrl(options["orthanc"].as<std::string>());
-      }
-
-      if (options.count("username"))
-      {
-        params.SetUsername(options["username"].as<std::string>());
-      }
-
-      if (options.count("password"))
-      {
-        params.SetPassword(options["password"].as<std::string>());
-      }
+      OrthancWSI::ApplicationToolbox::SetupRestApi(params, options);
 
       OrthancPlugins::OrthancHttpConnection orthanc(params);
       OrthancWSI::DicomPyramid source(orthanc, options["input"].as<std::string>(),