cURL / Mailing Lists / curl-library / Single Mail

curl-library

C program to send a XML file by HTTPS/POST

From: Marie-Laure Quintin <marie-laure.quintin_at_maileva.com>
Date: Tue, 30 Mar 2004 08:41:30 +0200

I am building an C program that uses libcurl to send a XML file by
HTTPS/POST.
When I execute the program, the function curl_easy_perform return the error
"CURLE_SSL_CONNECT_ERROR".

I build the object curl with theses parameters :
curl_global_init(CURL_GLOBAL_ALL);
curl=curl_easy_init();
headers=curl_slist_append(headers,"content-Type: text/xml");
curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
curl_easy_setopt(curl,
CURLOPT_URL,"https://www.test.com/EchangeServeur.htm");
curl_easy_setopt(curl, CURLOPT_WRITEHEADER,"resultat.xml");
curl_easy_setopt(curl, CURLOPT_PROXY, GetProxy()) ;
curl_easy_setopt(curl, CURLOPT_SSLCERT, GetCertFile());
curl_easy_setopt(curl, CURLOPT_SSLCERTPASSWD, GetPasswd());
curl_easy_setopt(curl, CURLOPT_SSLKEYPASSWD, GetPassphrase());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_formadd(&post, &last,
CURLFORM_COPYNAME,"XML_ENTREE",CURLFORM_FILE,filexml,CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_POST, post);
res=curl_easy_perform(curl);

The Certificate file and the private key file are in the same file.

Could you tell me what parameter i forget because when i execute the command
coul with the same parameters, it's OK.
Here's the command i execute :
>curl -v --cert certif.pem:<pass phrase> -pass <key password> -k -x
<proxy:80> -F XML_ENTREE=@in/demande.xml -output
resultat.xml --show-error --stderr erreurs.txt
https://www.test.com/EchangeServeur.htm

Thanks

Marie-Laure.
Received on 2004-03-30