cURL / Mailing Lists / curl-library / Single Mail

curl-library

Inconsistent SSL error

From: Leonce Limousin <llimousin_at_ehdl.com>
Date: Fri, 13 Sep 2002 02:43:47 -0400

I am using cURL on win2k. The application runs fine on my win2k workstation,
but when I move it to our win2k server I get
SSL: error:00000000::lib(0) :func(0) :reason(0)
on the first couple of attempts.

I am using libcurl 7.9.8 with OpenSSL-0.9.6g
It seems that it hangs in the SSL libs before the connection attempt.

I extensively browsed the mailing-list. Others have had similar problems,
but I am still not sure how to resolve it.

Is this a firewall issue? Both computers are on the same LAN.

Thank you!

Here are my CURLOPTs :

        curl_global_init( CURL_GLOBAL_ALL );

        if ( (cptr=curl_easy_init()) == NULL )
        {
                fprintf( stdout, "<h3>Could not open a libcurl
session.</h3>" );
                exit(1);
        }

        curl_easy_setopt( cptr, CURLOPT_ERRORBUFFER, curl_error_desc );

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_URL, url) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_POSTFIELDS, data) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_SSLCERT, ourCert) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_SSLKEY,
ourPrivateKey) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_SSLKEYPASSWD,
ehdlpwd) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_SSL_VERIFYPEER,
(long)1) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_CAINFO,
"certs/ca-cert-bundle.pem") )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }
/*
        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_EGDSOCKET,
"entropy") )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }
*/
        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_SSL_VERIFYHOST, 2) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_WRITEFUNCTION,
captureOutput) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

/*
        log = fopen( "e2a.log", "a+" );

        if ( CURLE_OK != curl_easy_setopt(cptr, CURLOPT_STDERR, log) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

        curl_easy_setopt(cptr, CURLOPT_VERBOSE, 1);
*/
        if ( CURLE_OK != curl_easy_perform(cptr) )
        {
                fprintf( stdout, "<h3>%s</h3>\n", curl_error_desc );
                return 2;
        }

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-09-13