I am attempting to write an application that uses libCurl to post soap requests to a secure web service. This Windows application is built against libCurl version 7.19.0 which, in turn, is built against openssl-0.9.8i. The pertinent curl related code follows:
FILE *input_file = fopen(current->post_file_name.c_str(), "rb"); FILE *output_file = fopen(current->results_file_name.c_str(), "wb"); if(input_file && output_file) { struct curl_slist *header_opts = 0; CURLcode rcd; header_opts = curl_slist_append(header_opts, "Content-Type: application/soap+xml; charset=utf8"); curl_easy_reset(curl_handle); curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, output_file); curl_easy_setopt(curl_handle, CURLOPT_READDATA, input_file); curl_easy_setopt(curl_handle, CURLOPT_URL, fs_service_url); curl_easy_setopt(curl_handle, CURLOPT_POST, 1); curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, header_opts); rcd = curl_easy_perform(curl_handle); if(rcd != 0) { current->curl_result = rcd; current->curl_error = curl_easy_strerror(rcd); } curl_slist_free_all(header_opts); }
When I attempt to execute the URL, curl returns an CURLE_OUT_OF_MEMORY error which appears to be related to a failure to allocate an SSL context. Has anyone else encountered this problem before?