cURL / Mailing Lists / curl-library / Single Mail


Problems with libcurl and C++ (error 58/60 &c.)

From: Milo Thurston <>
Date: Mon, 23 Jun 2008 12:02:06 +0100

I'm trying to write a small app. to loop through a list of files and
download them, amongst other things. The server from which the files
are being downloaded requires a self signed certificate, and I can
successfully retrieve files with the following:

curl --cert ./pass.pem https://server/ -k -o

However, my code fails with errors 58 or 60. Here's the basis of it:

  CURL *curl;
  CURLcode res;
  FILE *headerfile;
  headerfile = fopen("download_stdout.txt","w");
  curl = curl_easy_init();
  //filearr = list of files to download
  //path = download location

  for (j=0;j<total_number_of_files;j++)
      res = curl_easy_perform(curl);
      if (res == 0)
          printf("Successfully downloaded file %s\n",filearr[j]);
          printf("Failed to download file %s, error %d.\n",filearr[j],res);

This is, of course, derived from the examples provided with the
distribution. Can anyone suggest what is wrong with this that might
cause the errors I have been getting?

"One of the greatest delusions in the world is the hope that the evils in this
world are to be cured by legislation." - Thomas B. Reed 1886
Received on 2008-06-23