cURL / Mailing Lists / curl-library / Single Mail

curl-library

Getting error CURLE_SSL_CONNECT_ERROR intermittently

From: Raul Carolus <rcarolus_at_lightyeardt.com>
Date: Wed, 22 Feb 2006 14:58:24 -0600

I'm creating Windows c/c++ project compiled into a dll, and am using
libcurl 7.14, with openssl. This dll is used by another development
environment for external procedure calls.

I recently added a feature that starts a new thread for a process that
queries a website for information, to do a neat "behind the scenes"
feature. However, since adding this, I get this error.

The new thread function uses the easy functions for communications, and
it uses a local copy of a CURL structure. Here's basically what I do:

my_thread_funciton {
CURL * myCurl = NULL;

myCurl = curl_easy_init();
curl_easy_setopt(myCurl, ...);
(I set CURLOPT_URL, NOPROGRESS=1, COOKIE, WRITEFUNCTION, WRITEDATA,
HEADERDATA, SSL_VERIFYPEER = FALSE, ERRORBUFFER, POST=1, POSTFIELDS,
POSTFIELDSIZE)
curl_easy_perform(myCurl);
}

The error text returns: "SSL: couldn't set callback!"

Doing a search in the code, this occurs in libcurl in ssluse.c, at or
around line 1171.

I did some research and saw that a callback function needed to be
defined for multithreaded programs that use openssl. So I did this
using some examples as guidelines. However, this had no effect on the
error.

The strange part, if I try my other, non-threaded calls that use curl, I
get this same error. Those methods were working fine before.

To make matters even stranger, I created a test program in the other dev
environment to test this out. When I call the threaded method using
this test program, it works fine. But if I take the exact same dll and
move it to the real program, The same call gives me the above error.

What causes this error? Is there a way around it?

Thanks,

-- 
Raul Carolus
Lightyear Dealer Technologies
rcarolus_at_lightyeardt.com
Received on 2006-02-22