Search Results

Search found 8 results on 1 pages for 'haraldo'.

Page 1/1 | 1 

  • Using libcurl & SSL

    - by Haraldo
    Hi there. I've found there is really very little information around on this topic. I already have a dll making successful posts using libcurl. I've compiled libcurl with openssl for ssl functionality. Here is an exert of my original curl setup. curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errorBuffer); //curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , 1); //curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , 1); //curl_easy_setopt(curl, CURLOPT_CAINFO , "./ca.cert"); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, cParam); curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, strlen(cParam)); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, Request::writer); curl_easy_setopt(handle, CURLOPT_WRITEDATA, &buffer); curl_easy_setopt(handle, CURLOPT_URL, cURL); My question to those who've done this before, is it as easy as just adding those lines above to get SSL to work (as long as the certificate exists)? Or is it more complicated? The funny thing is I'm not completely sure how SSL works. I've never worked with it before. Do I need to store a key in my application and send it with each request? Anyway my main question was the first. Thank you in advance.

    Read the article

  • Compiling and linking libcurl to create a stand alone dll

    - by Haraldo
    Hi, I've managed to compile a dll with the necessary linked libraries (*.lib) and with CURL_STATICLIB set in the preprocessor section among other settings. I'm using "libcurl-7.19.3-win32-ssl-msvc.zip" package and compiling with VS 2008 express. This has been the first version I managed to get compiled properly with no link issues etc. The problem I have now is that my dll needs libcurl.dll to function and this is not ok. My dll needs to be independent. I have no idea how to implement this. I've taken all day just to get what I've got compiled. I've got runtime library set to Multi threaded dll (debug/release) respectively under C/C++ - code generation. I've a number of preprocessor set - CURL_STATICLIB being one of them. Configuration Type is set to Dynamic Library Use of MFC is set to Use MFC in a static library Additional Library Directories is set to the lib folders (debug/release) respectively. I've noticed there is a curllib_static.lib file which I've tried instead of curllib.lib as an additional dependency but it only compiles with the later. This is driving me nuts! So I guess I need some guidance as to how to make my dll completely static so it doesn't have any dependencies. I notice my dll is currently dependent on: CURLLIB.DLL MSVCR90D.DLL As I'm pretty new to C++ it could be a setting I'm missing in VS 2008 but I'm not sure. One person said I should be using a static library with *.a files (libcurl.a) etc but when I do this I get link errors which I haven't been able to resolve. Any guidance here would be much appreciated.

    Read the article

  • Using libcurl to create a valid POST

    - by Haraldo
    static int get( const char * cURL, const char * cParam ) { CURL *handle; CURLcode result; std::string buffer; char errorBuffer[CURL_ERROR_SIZE]; //struct curl_slist *headers = NULL; //headers = curl_slist_append(headers, "Content-Type: Multipart/Related"); //headers = curl_slist_append(headers, "type: text/xml"); // Create our curl handle handle = curl_easy_init(); if( handle ) { curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errorBuffer); //curl_easy_setopt(handle, CURLOPT_HEADER, 0); //curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(handle, CURLOPT_POST, 1); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, cParam); curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, strlen(cParam)); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, Request::writer); curl_easy_setopt(handle, CURLOPT_WRITEDATA, &buffer); curl_easy_setopt(handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); curl_easy_setopt(handle, CURLOPT_URL, cURL); result = curl_easy_perform(handle); curl_easy_cleanup(handle); } if( result == CURLE_OK ) { return atoi( buffer.c_str() ); } return 0; } Hi there, first of all I'm having trouble debugging this in visual studio express 2008 so I'm unsure what buffer.c_str() might actually be returning but I am outputting 1 or 0 to the web page being posted to. Therefore I'm expecting the buffer to be one or the other, however I seem to only be returning 0 or equivalent. Does the code above look like it will return what I expect or should my variable types be different? The conversion using "atoi" may be an issue. Any thought would be much appreciated.

    Read the article

  • DLL dependant on curllib.dll - How can I fix this?

    - by haraldo
    Hi there, I'm new to developing in C++. I've developed a dll where I'm using curllib to make HTTP requests. When running the dll via depend.exe it notifies me that my dll now depends on the curllib.dll. This simply doesn't work for me. My dll is set as a static library not shared and will be distributed on its own. I cannot rely on a user having libcurl.dll installed. I thought by including libcurl into my project this is all that would be needed and my dll could be independent. If this is impossible to resolve is there an alternative method I can use to create HTTP requests? Obviously I would prefer to use libcurl. Thanks in advance.

    Read the article

  • Can't append to array using string field name [$] when performing update on array fields

    - by Haraldo
    rowsI am attempting to perform a mongodb update on each field in an array of records. An example schema is below: { "_id" : ObjectId("508710f16dc636ec07000022"), "summary" : "", "uid" : "ABCDEF", "username" : "bigcheese", "name" : "Name of this document", "status_id" : 0, "rows" : [ { "score" : 12, "status_id" : 0, "uid" : 1 }, { "score" : 51, "status_id" : 0, "uid" : 2 } ] } So far I have been able to perform single updates like this: db.mycollection.update({"uid":"ABCDEF","rows.uid":1}, {$set:{"rows.$.status_id":1}},false,false) However, I am struggling as to how to perform an update that will update all array records to a status_id of 1 (for instance). Below is how I imagine it should work: db.mycollection.update({"uid":"ABCDEF"}, {$set:{"rows.$.status_id":1}},false,true) However I get the error: can't append to array using string field name [$] I have tried for quite a while with no luck. Any pointers?

    Read the article

  • Handling multiple HTTP requests from one source (e.g.a hacker)

    - by Haraldo
    Hi there, I have a script to handle http requests. I'm trying to think of some of the security issues I might have with it. My biggest concern at the moment is how I can manage multiple requests from the same source over and over. For instance someone trying to shut down my system. Do I need to be concerned or will Apache handling this issue. If not what is the best approach to take using php? Thanks,

    Read the article

  • Trouble echoing data - data being converted to 0

    - by Haraldo
    Hi, I feel this is something to do with my httpd setup for apache. I'm using mod_rewrite if that helps but I think that only effects the url. It seems when I output some data such as: $sMessage = 'Error'; echo $sMessage; It works fine but when I do this: $sMessage = 'Error'; echo ''+$sMessage+''; It returns 0. Very odd!

    Read the article

1