diff Plugins/Include/orthanc/OrthancCPlugin.h @ 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 364cc624eb65
children fefbe71c2272
line wrap: on
line diff
--- a/Plugins/Include/orthanc/OrthancCPlugin.h	Tue Jun 14 15:51:00 2016 +0200
+++ b/Plugins/Include/orthanc/OrthancCPlugin.h	Tue Jun 14 17:53:23 2016 +0200
@@ -4943,6 +4943,9 @@
     const char*                 username;
     const char*                 password;
     uint32_t                    timeout;
+    const char*                 certificateFile;
+    const char*                 certificateKeyFile;
+    const char*                 certificateKeyPassword;
   } _OrthancPluginCallHttpClient2;
 
 
@@ -4966,6 +4969,12 @@
    * @param body The body of the POST request.
    * @param bodySize The size of the body.
    * @param timeout Timeout in seconds (0 for default timeout).
+   * @param certificateFile Path to the client certificate for HTTPS, in PEM format
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param certificateKeyPassword Password to unlock the key of the client certificate 
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
    * @return 0 if success, or the error code if failure.
    **/
   ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpClient(
@@ -4981,7 +4990,10 @@
     uint32_t                    bodySize,
     const char*                 username,
     const char*                 password,
-    uint32_t                    timeout)
+    uint32_t                    timeout,
+    const char*                 certificateFile,
+    const char*                 certificateKeyFile,
+    const char*                 certificateKeyPassword)
   {
     _OrthancPluginCallHttpClient2 params;
     memset(&params, 0, sizeof(params));
@@ -4998,6 +5010,9 @@
     params.username = username;
     params.password = password;
     params.timeout = timeout;
+    params.certificateFile = certificateFile;
+    params.certificateKeyFile = certificateKeyFile;
+    params.certificateKeyPassword = certificateKeyPassword;
 
     return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
   }