cURL / Mailing Lists / curl-library / Single Mail

curl-library

SSL error w/libcurl 7.10, need help

From: Derek Ealy <dealy663_at_hotmail.com>
Date: Fri, 24 Jan 2003 16:48:52 -0800

Hi,

Today I downloaded libcurl 7.10.3 and also the latest version of OpenSSL.
After getting them built and installed I'm getting this error message when
trying to retrieve a page via https:

Caught exception: SSL: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:c
ertificate verify failed

I've tried using CURLOPT_CAPATH and pointing it to a dir with the
ca-bundle.crt file but that isn't helping.

Its doubly confusing because when I use the command line version of curl to
access these https urls it works with no problem. Any idea of what is wrong
here?

This is all on Windows 2000, I used VC++ to compile everything.

Thanks, Derek

Here is the curl code in question:

  CURL* curl_handle;

  curl_handle = curl_easy_init();

  string strCredCookie;

  if(curl_handle) {
      chunk.memory=NULL; /* we expect realloc(NULL, size) to work */
      chunk.size = 0; /* no data at this point */

      /* init the curl session */
      curl_handle = curl_easy_init();

      /* specify URL to get */
      curl_easy_setopt(curl_handle, CURLOPT_URL, strUrl.c_str());

      if (m_strCAPath.length() > 0)
        curl_easy_setopt(curl_handle, CURLOPT_CAPATH, m_strCAPath.c_str());

      string strPostData("uid=");
      strPostData += strUserid + "&password=" + strPw + "&ipaddr=" +
strIpAddr;

// curl_easy_setopt(curl, CURLOPT_POSTFIELDS, strPostData.c_str());

      /* send all data to this function */
      curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION,
                       CredCookieGenerator::writeMemoryCallback);

      /* we pass our 'chunk' struct to the callback function */
      curl_easy_setopt(curl_handle, CURLOPT_FILE, (void *)&chunk);

      /* set the error buffer so we can get some feedback if there are any
         problems */
      curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, pszErrorBuffer);

      /* get it! */
      if (curl_easy_perform(curl_handle)) {
              throw string(pszErrorBuffer);
      } // end if (curl_easy_perform...

      /* cleanup curl stuff */
      curl_easy_cleanup(curl_handle);

      strCredCookie = chunk.memory;
  }

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-25