cURL / Mailing Lists / curl-library / Single Mail

curl-library

Sending a SSL message

From: Curti Roberto <roberto.curti_at_libero.it>
Date: Mon, 15 Jan 2007 09:20:23 +0100

Hi,
I have a problem sending a message in SSL (Openssl 0.9.7d).
These are the characteristics:
- RSA authentication and 3DES cipher (algorithm SSL_RSA_WITH_3DES_EDE_CBC_SHA)
- The Key is provided by another system/application, the certificate is copied on my system.

My curl version is 7.15.1 (S.O. TRU64 V5.1B)

This I my code:
ret = curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
....
if (curl_easy_setopt(curl_handle, CURLOPT_URL, hostValue)){
        printf( "Error Setting option %d ", CURLOPT_URL);
}
....
if (curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE)){
        printf( "Error Setting option %d ", CURLOPT_SSL_VERIFYPEER);
}
if (curl_easy_setopt(curl_handle, CURLOPT_CAINFO, certFile)){
        printf( "Error Setting option %d ", CURLOPT_CAINFO);
}
if (curl_easy_setopt(curl_handle, CURLOPT_CAPATH, chCertPath)){
        printf( "Error Setting option %d ", CURLOPT_CAPATH);
}
if (curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0)){
        printf( "Error Setting option %d ", CURLOPT_SSL_VERIFYHOST);
}

memset(buffer, 0, sizeof(buffer));
if (curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, writeSoapResponse)){
        printf( "Error Setting option %d ", CURLOPT_WRITEFUNCTION);
}
if (curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, buffer)){
        printf( "Error Setting option %d ", CURLOPT_WRITEDATA);
}
if (curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, errBuffer)){
        printf( "Error Setting option %d ", CURLOPT_ERRORBUFFER);
}
                                                                                                                      
ret = curl_easy_perform(curl_handle);
if (ret != CURLE_OK){
        printf( "Error [%d] (%s).", ret, errBuffer);
}
....

I’m able to send my message but the system receiving it is not able to read.

What’s wrong with this code? Any suggestion?
Thanks in advance
Roberto

------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada15gen07
Received on 2007-01-15