Index: trunk/docs/kernel/configuration.rst
===================================================================
--- trunk/docs/kernel/configuration.rst	(revision 943)
+++ trunk/docs/kernel/configuration.rst	(revision 944)
@@ -1,2 +1,3 @@
+
 .. _kernel_config:
 
@@ -158,4 +159,19 @@
     Access-Control-Allow-Headers=content-type
 
+curl section
+...............................
+
+The `[curl]` section is used on windows platform to specify, using the
+`cainfo` parameter, where is located the
+`cacert.pem <https://curl.haxx.se/docs/caextract.html>`__ file on your
+machine. An example bellow is provided to illustrate sur a setting. 
+
+.. code-block:: guess
+    :linenos:
+    
+    [curl]
+    cainfo=./cacert.pem
+
+
 
 env section
@@ -176,5 +192,5 @@
 
 In case you have activated the OTB support, please refer to :ref:`this
-specific section <kernel-orfeotoolbox-main.cfg>`. 
+specific section <kernel-orfeotoolbox-main.cfg>`.
 
 lenv section
Index: trunk/zoo-project/HISTORY.txt
===================================================================
--- trunk/zoo-project/HISTORY.txt	(revision 943)
+++ trunk/zoo-project/HISTORY.txt	(revision 944)
@@ -1,3 +1,5 @@
-Version 1.7.0-dev
+Version 1.8.0-dev
+  * Fix #172
+Version 1.7.0
   * Fix issue with UOM definitions in zcfg2sql
   * Make callback and HPC support independent from each other
Index: trunk/zoo-project/zoo-kernel/ulinet.c
===================================================================
--- trunk/zoo-project/zoo-kernel/ulinet.c	(revision 943)
+++ trunk/zoo-project/zoo-kernel/ulinet.c	(revision 944)
@@ -82,5 +82,5 @@
 { 
    size_t realsize = size * nmemb;
-   int writen=0;
+   size_t writen=0;
    _HINTERNET *psInternet;
    if(buffer==NULL){
@@ -306,5 +306,5 @@
  */
 int AddMissingHeaderEntry(_HINTERNET* handle,const char* key,const char* value){
-  int length=strlen(key)+strlen(value)+3;
+  size_t length=strlen(key)+strlen(value)+3;
   char *entry=(char*)malloc((length)*sizeof(char));
   if(entry==NULL)
@@ -326,5 +326,4 @@
 	char *token, *saveptr;
 	int cnt;
-	char* host;
 
 	// knut: make a copy of url since strtok family modifies first argument and cannot be used on constant strings  
@@ -374,5 +373,5 @@
 	token = strtok_r (tmp, ",", &saveptr);
 	while (token != NULL){
-	  int length=strlen(token)+6;
+	  size_t length=strlen(token)+6;
 	  char* tmp1=(char*)malloc(length*sizeof(char));
 	  map* tmpMap;
@@ -414,5 +413,5 @@
       if(handle.hasCacheFile>0){
 	fclose(handle.file);
-	unlink(handle.filename);
+	zUnlink(handle.filename);
 	free(handle.filename);
       }
@@ -483,7 +482,11 @@
   hInternet->ihandle[hInternet->nb].id = hInternet->nb;
   hInternet->ihandle[hInternet->nb].nDataAlloc = 0;
+  hInternet->ihandle[hInternet->nb].code = -1;
   hInternet->ihandle[hInternet->nb].pabyData = NULL;
   hInternet->ihandle[hInternet->nb].post = NULL;
-  
+
+  map* caBundle=getMapFromMaps((maps*) conf,"curl","cainfo");
+  if(caBundle!=NULL)
+    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_CAINFO,caBundle->value);
   curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle, CURLOPT_COOKIEFILE, "ALL");
 #ifndef TIGER
@@ -626,5 +629,5 @@
     if(tmp!=NULL)
       hInternet->ihandle[i].mimeType=zStrdup(tmp);
-    curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&hInternet->ihandle[i].code);
+    curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&(hInternet->ihandle[i].code));
     curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle);
     curl_easy_cleanup(hInternet->ihandle[i].handle);
@@ -658,5 +661,5 @@
  */
 int InternetReadFile(_HINTERNET hInternet,LPVOID lpBuffer,int dwNumberOfBytesToRead, size_t *lpdwNumberOfBytesRead){
-  int dwDataSize;
+  size_t dwDataSize;
 
   if(hInternet.hasCacheFile>0){
@@ -684,5 +687,5 @@
 
   if(hInternet.hasCacheFile>0){
-    int freadRes = fread(lpBuffer,dwDataSize+1,1,hInternet.file); 
+    size_t freadRes = fread(lpBuffer,dwDataSize+1,1,hInternet.file); 
     *lpdwNumberOfBytesRead = hInternet.nDataLen;
   }
Index: trunk/zoo-project/zoo-kernel/ulinet.h
===================================================================
--- trunk/zoo-project/zoo-kernel/ulinet.h	(revision 943)
+++ trunk/zoo-project/zoo-kernel/ulinet.h	(revision 944)
@@ -75,4 +75,9 @@
    */
   typedef struct {
+    long code; //!< the last received response code
+    int hasCacheFile; //!< 1 if we used a cache file
+    int id; //!< The position of the element in the queue
+    size_t nDataLen; //!< the length of the downloaded content
+    size_t nDataAlloc; //!< 
     CURL *handle; //!< the CURL handler
     struct curl_slist *header; //!< the headers to send
@@ -84,9 +89,4 @@
     char *post; //!< the potential POST XML content
     char* cookie; //!< The potential Cookie returned by the server
-    int hasCacheFile; //!< 1 if we used a cache file
-    int nDataLen; //!< the length of the downloaded content
-    int nDataAlloc; //!< 
-    long code; //!< the last received response code
-    int id; //!< The position of the element in the queue
   } _HINTERNET;
 
@@ -95,9 +95,9 @@
    */
   typedef struct {
+    int nb; //!< number of element in the queue 
     CURLM *handle; //!< the CURLM handler
     _HINTERNET ihandle[MAX_REQ]; //!< individual handlers in the queue 
     char *waitingRequests[MAX_REQ]; //!< request in the queue
     char *agent; //!< The User-Agent to use for HTTP request
-    int nb; //!< number of element in the queue 
   } HINTERNET;
 
